The document discusses creating and inserting values into tables in a database. It provides examples of SQL commands to create a student table with an integer primary key and character and varchar columns, and to insert values into the student table. It also lists questions about creating an employee table, inserting values, displaying employee salaries, counting departments, and querying employee names.
The document discusses creating and inserting values into tables in a database. It provides examples of SQL commands to create a student table with an integer primary key and character and varchar columns, and to insert values into the student table. It also lists questions about creating an employee table, inserting values, displaying employee salaries, counting departments, and querying employee names.
The document discusses creating and inserting values into tables in a database. It provides examples of SQL commands to create a student table with an integer primary key and character and varchar columns, and to insert values into the student table. It also lists questions about creating an employee table, inserting values, displaying employee salaries, counting departments, and querying employee names.
Creating a basic table involves naming the table and defining its columns and each column’s data type. SYNTAX: create table table_name(column1 data type primary key, column2 data type, column3 data type…… QUERY: For creating student table the following command is: create table student_1(id integer(3) primary key, name char(20), email varchar(30)); OUTPUT:
For inserting values:
Insert into statement is used to insert new records in table SYNTAX: insert into table_name values(value1, value2,…..) QUERY: For inserting values in student table the following command is insert: insert into student_1 values (1, “roy”, roysingh123@gmail.com); and many more.. Output:
Q3. Create employee table & insert values in it.
Insert values in it
Q6. Display all employee salary.
Q7. Display total number of departments in the company. Q9. Display the names of the employee whose name starts with “a”.
Q10. Display name of those employee whose second alphabet is ‘a’ .
Q11. Display id & name of those employees who lives in delhi/mumbai.