3/2/2024 0 Comments Dateadd in postgresqlTRUNCATE: Removes all rows, faster than DELETE. Difference between DELETE, TRUNCATE, and DROP statements? Inner Join, Left (Outer) Join, Right (Outer) Join, Full Join, Self Join, Cross Join.ġ1. DENSE_RANK(): Provides a unique rank for tied values without gaps. RANK(): May have gaps in ranks for tied values. Difference between the RANK() and DENSE_RANK() functions? Common clauses used with SELECT query in SQL?ĩ. SQL(Structured Query Language) is the language you use to communicate with databases, and MySQL is one of the many tools that listen to that language and manage the data for you.Ĩ. Normalization: Breaks down data into smaller, related tables to reduce redundancy.ĭenormalization: Reverse of normalization, introducing redundancy for performance. What are Normalization and denormalization and their types? Foreign Key: Refers to the Primary Key in another table, ensuring referential integrity.Ħ. Primary Key: Unique identifier for a record in a table. Difference between Primary Key & Foreign Key PRIMARY KEY - Uniquely identifies each record in a table.įOREIGN KEY - Ensures referential integrity for a record in another table.ĥ. INDEX - Indexes a field providing faster retrieval of records. UNIQUE - Ensures unique values to be inserted into the field. NOT NULL - Restricts NULL value from being inserted into a column.ĬHECK - Verifies that all values in a field satisfy a condition.ĭEFAULT - Automatically assigns a default value if no value has been specified for the field. TCL (Transaction Control Language): COMMIT, ROLLBACK, SAVEPOINT. DCL (Data Control Language): GRANT, REVOKE. DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE. DDL (Data Definition Language): CREATE, DROP, ALTER. Fields: Columns in a table rows are called records. Tables: Organize data in rows and columns. RDBMS (Relational Database Management System) organizes data into tables. DBMS (Database Management System) is software used to store, retrieve, and query data, acting as a file manager for database content. □ Top SQL Interview Questions with Answers for Analyst □ Save this post for later and Follow Mazher Khan for more such posts. PostgreSQL/Oracle: EXTRACT(DAY FROM date)ĭate Formatting:PostgreSQL/Oracle: TO_CHAR(date, 'YYYY-MM-DD') PostgreSQL/Oracle: EXTRACT(MONTH FROM date) PostgreSQL/Oracle: EXTRACT(YEAR FROM date) Below are some important and most-used date functions:ġ. Playing with dates in SQL can be confusing due to the wide array of functions and syntax used in different database systems.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |