0% found this document useful (0 votes)
46 views

SQL Pres

The document discusses SQL commands for creating tables, selecting data, and eliminating duplicate rows. It provides examples of using the CREATE TABLE command to define a table structure with data types and sizes for columns. The SELECT command is used to query data from tables by specifying column names. The DISTINCT keyword can be used with the SELECT statement to remove duplicate rows from the results.

Uploaded by

VkvDibrugarh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

SQL Pres

The document discusses SQL commands for creating tables, selecting data, and eliminating duplicate rows. It provides examples of using the CREATE TABLE command to define a table structure with data types and sizes for columns. The SELECT command is used to query data from tables by specifying column names. The DISTINCT keyword can be used with the SELECT statement to remove duplicate rows from the results.

Uploaded by

VkvDibrugarh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

STRUCTURED QUERY LANGUAGE

Create table Command-


Create table <table-name>
(<column-name> <data type> [(<size>)],
<column-name> <data type> [(<size>)….]);

Eg: To create table Employee with following scheme.


Table name :Student(scode, sname, sex, total, grade)

Create table Student(scode number(4),


sname char(20), sex char(1), total number(2),
grade char);
SELECT COMMAND:
• SELECT command make queries on the database. A
QUERY is a command that is given to produce
certain specified information from the database
tables
SELECT <column name> [, <column name>,….]
From <table name>;
Eg. (1) SELECT scode, sname from student;
(2) SELECT * from student (to view all column in
student table)
DISTINCT keyword:
DISTINCT keyword eliminates duplicates rows from
the results of a SELECT statement
Eg. Select DISTINCT department from employee;
In the output there would be no duplicate rows.

You might also like