0% found this document useful (0 votes)
2 views8 pages

SQL database table

The document outlines key SQL commands and concepts including creating databases and tables, inserting and updating data, altering tables, and deleting records. It explains the syntax for each command and the purpose of clauses such as ORDER BY and HAVING. Overall, it serves as a guide for basic SQL operations and their functionalities.

Uploaded by

abhishekvish36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

SQL database table

The document outlines key SQL commands and concepts including creating databases and tables, inserting and updating data, altering tables, and deleting records. It explains the syntax for each command and the purpose of clauses such as ORDER BY and HAVING. Overall, it serves as a guide for basic SQL operations and their functionalities.

Uploaded by

abhishekvish36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Name :- Abhishek Vishwakarma

Assignment date:- 04th October 22


Submission Date :- 05th October 22
Topics :- Create Database in SQL

1. Create Database in SQL:-

 The basic syntax of this CREATE DATABASE statement is as follows –


 CREATE DATABASE databaseName;
2. Create Table:-
 Creating a basic table involves naming the table and defining its columns and each
column's data type.
 The SQL CREATE TABLE statement is used to create a new table.

3. Insert Query:-
 The SQL INSERT INTO Statement is used to add new rows of data to a table in the
database.

4. Alter in SQL:-

 The ALTER TABLE statement in Structured Query Language allows you to add,
modify, and delete columns of an existing table. This statement also allows database
users to add and remove various SQL constraints on the existing tables.

 Any user can also change the name of the table using this statement.

 ALTER TABLE ADD Column statement in SQL:-


 ALTER TABLE DROP Column statement in SQL:-

 ALTER TABLE MODIFY Column statement in SQL:-


5. Update in SQL:-

 The SQL commands (UPDATE and DELETE) are used to modify the data that is
already in the database. The SQL DELETE command uses a WHERE clause.

 SQL UPDATE statement is used to change the data of the records held by tables.
Which rows is to be update, it is decided by a condition. To specify condition, we use
WHERE clause.

6. SQL Delete Table:-

 The DELETE statement is used to delete rows from a table. If you want to remove a
specific row from a table you should use WHERE condition.
7. Order by Clause:-

 The SQL ORDER BY clause is used to sort the data in ascending or descending
order, based on one or more columns. Some databases sort the query results in
an ascending order by default.

 Ascending Order:-
 Descending Order:-
8. Having Clause in SQL:-

 This SQL clause is implemented after the 'GROUP BY' clause in the 'SELECT'
statement.

 This clause is used in SQL because we cannot use the WHERE clause with the SQL
aggregate functions. Both WHERE and HAVING clauses are used for filtering the
records in SQL queries.

You might also like