Create Table in SQL
Table: In SQL, a table is a set of data that is displayed systematically in rows and columns. To create a new table, use the CREATE TABLE statement. Syntax: Example: Output: Note: We can use the DESC command to see the created table. DESC EMPLOYEE;
Drop Database In SQL
The DROP DATABASE statement is used to delete or drop an existing database. Syntax: Example:
SQL Select Database
If the SQL schema contains multiple databases, we must choose one before performing any operations. The USE statement is used to select any database in the SQL schema that already exists. Syntax: Example:
SQL Show Database List
To show the list of all existing databases in SQL schema we have to use the SHOW DATABASES statement. Syntax:
SQL Create Database
The SQL CREATE DATABASE statement is used to create a new database. Syntax: CREATE DATABASE databaseName;Note: Database name should be unique within the RDBMS. Example: CREATE DATABASE w3spoint_db;
SQL operators
Operator: A special symbol called an operator is used to perform a specific operation. SQL operators: The reserved words, special symbols, or characters that are used to perform specific operations in SQL are known as SQL operators. Types of SQL operators: SQL Arithmetic Operators SQL Comparison Operators SQL Logical Operators 1. SQL Arithmetic Operators: Consider […]
SQL Data Types
The type and range of data that can be used with SQL Server are defined by SQL data types. Data Type Syntax Description integer integer Integer number. smallint smallint Small integer number. numeric numeric(p,s) Where p is a precision value; s is a scale value. For example, numeric(7,3) is a number that has 4 digits […]
SQL Syntax List
Syntax: The structure of statements in a computer language is defined by syntax, which is a set of rules and guidelines. SQL syntax: The structure of SQL statements is defined by a set of rules and guidelines known as SQL syntax. SQL is case insensitive. Commonly used SQL commands: 1. SELECT – It is used […]