Computer Science, asked by aggarwalsiddhi4, 7 months ago

1.Write SQL commands for the following: a) To create a new database named as COMPANY. b) To open an existing database SCHOOL. c) To display the list of existing databases. d) To open an existing database from the list of databases named as DEPARTMENT. e) To remove the existing database p Show the structure of the table employee. g) To remove all the records of existing table named as SALES. h) Insert 2records into the table employee as well as Job. i) Remove employee table permanently. j)count the total records in the table employee.​

Answers

Answered by Equestriadash
18

a) To create a new database named 'COMPANY'.

  • Creαte dαtαbαse Company(attribute1 datatype, attribute2 datatype, attribute3 datatype);

b) To open an existing database 'SCHOOL'.

  • Use School;
  • Show tables;

c) To display the list of existing databases.

  • Show databases;

d) To open an existing database from the list of databases named as 'DEPARTMENT'.

  • Use Department;
  • Show tables;

e) To remove the existing database.

  • Drop database <database_name>;

f) Show the structure of the table 'EMPLOYEE'.

  • Desc Employee;

g) To remove all the records of the existing table named 'SALES'.

  • Delete from Sales where Sales;

h) Insert 2 records into the table 'EMPLOYEE'.

  • Insert into Employee values(<value1>, <value2>, < > );

i) Remove 'EMPLOYEE' table permanently.

  • Drop table Employee;

j) Count the total records in the table 'EMPLOYEE'.

  • Select Count(*) from Employee;

Similar questions