Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
400 views

SQL Command PDF

The document discusses various SQL commands including selecting data from tables, arithmetic and relational operators, where clauses, aliases, between conditions, IN and NOT IN operators, and wildcard characters for pattern matching. Some key SQL commands covered are SELECT, FROM, WHERE, LIKE, BETWEEN, IN and arithmetic operators. Examples are provided for each concept to demonstrate their usage.

Uploaded by

sharique alam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
400 views

SQL Command PDF

The document discusses various SQL commands including selecting data from tables, arithmetic and relational operators, where clauses, aliases, between conditions, IN and NOT IN operators, and wildcard characters for pattern matching. Some key SQL commands covered are SELECT, FROM, WHERE, LIKE, BETWEEN, IN and arithmetic operators. Examples are provided for each concept to demonstrate their usage.

Uploaded by

sharique alam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

XII CS : 19-10-2020 (By D.

Kumar)

Topic : SQLCommands

SQL > Select *from student;

SQL> select name, gender from student;

SQL > select *from student where rollno<=8;

SQL>select Name,rollno, dob, marks from student;

SQL> select stream from student;

Sql>select distinct stream from student;

SQL Operators

Arithmetic
Relational
Logical
Special

SQL> select 5+10;


15
Or
SQL >select 5+10 from DUAL;
15
SQL> select 5*4 from DAUL;
20
Sql> SELECT 47%5 FROM DUAL;
2

Sql> SELECT rollno, name, marks from student


Where marks>=90;

SQL>select *from student


Where stream <>'Commerce'

SQL> select *from student where marks>80 and Gender='M';

SQL> select RollNo, Name, Stream, from student


Where stream='science' or stream='commerce'

SQL>select name,marks from student


Where Not(stream='vocational');

SQL Aliases

SQL> select Name as "Student_name", DOB as "Date of Birth" from student;

SQL>select rollno, name, 'was born on', DOB from student;

SQL> select rollno, name, marks from student


Where marks between 80 and 100;

SQL> select rollno, name, marks from student


Where marks NOT between 80 and 100;

SQL> select *from student where stream IN('Science', 'Commerce','Humanities');

SQL> select *from student where stream NOT IN('Science',


'Commerce','Humanities');
Conditionals Based on Pattern –
(Wildcard Character)
Percentage : % (Matches any string) : Windows OS - *
Underscore : _ (Matches any one character) : Windows OS - ?

SQL>select *from student where name LIKE "D%";

SQL>select *from student where name LIKE " %a";

SQL>select *from student where name LIKE " %e%";

SQL>select *from student where name LIKE " _e%";

SQL>select *from student where name LIKE " %r_ _";

You might also like