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.
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.
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_ _";