- What is the difference between SQL and MySQL?
- What do you mean by DBMS? What are its different types?
- What are the types of joins in SQL? Give an example for each one.
- What is a Primary key?
- What are the different operators available in SQL?
- What is the need for group functions in SQL?
- What is a Relationship and what are they?
Please discuss these questions with your partners and post your answers as a comment on this gist when you are finished.
answers, Room 2
SQL is a language used to manage relational databases, while MySQL is a specific relational database management system (RDBMS) that uses SQL.
DBMS stands for Database Management System. Different types include relational, object-oriented, hierarchical, network, and NoSQL databases
these are the types of joins in SQL with examples :
(INNER) JOIN: Returns records that have matching values in both tables
SELECT StudentCourse.COURSE_ID, Student.NAME, Student.AGE FROM Student
INNER JOIN StudentCourse
ON Student.ROLL_NO = StudentCourse.ROLL_NO;
LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table
SELECT Student.NAME,StudentCourse.COURSE_ID
FROM Student
LEFT JOIN StudentCourse
ON StudentCourse.ROLL_NO = Student.ROLL_NO;
RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table
SELECT Student.NAME,StudentCourse.COURSE_ID
FROM Student
RIGHT JOIN StudentCourse
ON StudentCourse.ROLL_NO = Student.ROLL_NO;
FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table
SELECT Student.NAME,StudentCourse.COURSE_ID
FROM Student
FULL JOIN StudentCourse
ON StudentCourse.ROLL_NO = Student.ROLL_NO;
the Primary key is the column that the data will be ordered on, it's unique and not null.
Different operators in SQL include comparison operators (e.g., =, <, >), logical operators (e.g., AND, OR, NOT), and arithmetic operators (e.g., +, -, *, /).
Group functions in SQL, such as SUM, AVG, COUNT, MAX, and MIN, are essential for performing calculations on sets of rows in a database table. They help aggregate and summarize data, providing valuable insights into the dataset. For example:
Group members name :