Podcast
Questions and Answers
Which function is used to find the length of a string in SQL?
Which function is used to find the length of a string in SQL?
Which group function in SQL calculates the average of a set of values?
Which group function in SQL calculates the average of a set of values?
What does the DML Command 'DELETE' do in SQL?
What does the DML Command 'DELETE' do in SQL?
Which SQL clause is used for sorting data in ascending or descending order?
Which SQL clause is used for sorting data in ascending or descending order?
Signup and view all the answers
Which operator is used to concatenate strings in SQL?
Which operator is used to concatenate strings in SQL?
Signup and view all the answers
Which command in SQL is used to create a new table?
Which command in SQL is used to create a new table?
Signup and view all the answers
What does the SQL function 'INITCAP' do?
What does the SQL function 'INITCAP' do?
Signup and view all the answers
In SQL, which clause is used to specify the conditions on groups when GROUP BY is used?
In SQL, which clause is used to specify the conditions on groups when GROUP BY is used?
Signup and view all the answers
Which function in SQL is used to find the square root of a number?
Which function in SQL is used to find the square root of a number?
Signup and view all the answers
What does the DDL Command 'ALTER' do for tables in SQL?
What does the DDL Command 'ALTER' do for tables in SQL?
Signup and view all the answers
In SQL, which operator is used to specify multiple columns for sorting data?
In SQL, which operator is used to specify multiple columns for sorting data?
Signup and view all the answers
Study Notes
SQL Components
- SQL consists of data types, operators, DDL (Data Definition Language) commands, and DML (Data Manipulation Language) commands.
DDL Commands
- CREATE command: used to create tables
- ALTER command: used to modify existing tables
- DROP command: used to delete tables
DML Commands
- SELECT command: used to retrieve data from tables
- INSERT command: used to add new data to tables
- DELETE command: used to delete data from tables
- UPDATE command: used to modify existing data in tables
Query Clauses
- ORDER BY clause: used to sort data in ascending or descending order
- GROUP BY clause: used to group data based on one or more columns
- HAVING clause: used to filter grouped data based on conditions
Views
- A view is a virtual table based on the result of a query
- DML operations can be performed on views
Functions
Numeric Functions
- ABS: returns the absolute value of a number
- MOD: returns the remainder of a division operation
- FLOOR: returns the largest integer less than or equal to a number
- CEIL: returns the smallest integer greater than or equal to a number
- TRUNC: returns the truncated value of a number
- SQRT: returns the square root of a number
- SIGN: returns the sign of a number (1 if positive, -1 if negative, 0 if zero)
- SIN, COS, LOG, EXP: returns the sine, cosine, logarithm, and exponential of a number, respectively
- LEAST, GREATEST: returns the smallest or largest of two or more values
Group Functions
- AVG: returns the average value of a set of numbers
- MAX: returns the maximum value of a set of numbers
- MIN: returns the minimum value of a set of numbers
- SUM: returns the sum of a set of numbers
- COUNT: returns the count of a set of values
Character Functions
- LENGTH: returns the length of a string
- LOWER, UPPER: returns the lowercase or uppercase version of a string
- INITCAP: returns the capitalized version of a string
- INSTR: returns the position of a substring within a string
- SUBSTR: returns a subset of a string
- LPAD, RPAD: returns a string padded with a specified character on the left or right
- LTRIM, RTRIM: returns a string with leading or trailing characters removed
- DECODE: returns a decoded value based on a set of conditions
- SOUNDEX: returns the soundex code of a string
Conversion Functions
- TO-NUMBER: converts a string to a number
- TO-CHAR: converts a number to a string
Joins and Unions
- Joins: combine data from multiple tables based on a common column
- Unions: combine the results of multiple queries into a single result set
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Test your knowledge on SQL components such as data types, operators, DDL and DML commands like CREATE, ALTER, DROP, SELECT, INSERT, DELETE, UPDATE, order by clause, Group by, Having clause, views, and various functions including Numeric, Group, Character, and Conversion functions.