Skip to content

Instantly share code, notes, and snippets.

@halitbatur
Last active November 5, 2021 19:17
Show Gist options
  • Save halitbatur/36b9a757e6679b53b191d8e83bb7befc to your computer and use it in GitHub Desktop.
Save halitbatur/36b9a757e6679b53b191d8e83bb7befc to your computer and use it in GitHub Desktop.
SQL discussion questions

SQL discussions

  1. What is the difference between SQL and MySQL?
  2. What do you mean by DBMS? What are its different types?
  3. What are the types of joins in SQL? Give an example for each one.
  4. What is a Primary key?
  5. What are the different operators available in SQL?
  6. What is the need for group functions in SQL?
  7. 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.

@Kishimoto96
Copy link

  1. SQL is a database manipulation language and MySQL relational Database management system based on SQL language.
  2. It means : Database Management System, Hierarchical database, Network database, Relational database, Object-Oriented database.
  3. Inner join returns rows with at least one match in both tables.
    Left (outer) join returns rows from left table and the matched rows from right table.
    Right (outer) join returns rows from right table and the matched rows from left table.
    Full (outer) join returns rows with a match in either of the two tables.
  4. it's a key that should have a unique value for each row.
  5. Arithmetic Operators
    Comparison Operators
    Logical Operators
    Compound Operators
    Bitwise Operators.
    Set Operators
    String Operators
    Unary Operators
  6. To get specific set of rows from a database.
  7. It's specifies the connection between two or more tables in a database and there are three types: one-to-one, one-to-many and many-to-many relationships.

@mkkasem
Copy link

mkkasem commented Nov 4, 2021

Room 5
0. SQL is a language and MySQL is an open-source database server.

  • Database Management System (DBMS) is software designed to store, retrieve, define, and manage data in a database.
  • DBMS Types are: 1) Relational Database 2) NoSQL Database
  • Inner Join / Simple Join: The inner join is used to select all matching rows or columns in both tables.
  • Left Outer Join / Left Join: Returns all records from the left table (table1), and the matching records from the right table.
  • Right Outer Join / Right Join: Returns all records from the right table (table1), and the matching records from the left table.
  • Full Outer Join: It is a combined result set of both LEFT JOIN and RIGHT JOIN. The joined tables return all records from both tables.
  • Cross Join: It is also known as CARTESIAN JOIN, which returns the Cartesian product of two or more joined tables.
  • Self Join: It is a SELF JOIN used to create a table by joining itself as there were two tables.
  • Arithmetic operators
  • Bitwise operators
  • Compound operators
  • Logical operators
  • Logical Operators
  • String operators
    4-
    AVG, that calculates the average of the specified columns in a set of rows,
    COUNT, calculating the number of rows in a set.
    MAX, calculating the maximum,
    MIN, calculating the minimum,
    STDDEV, calculating the standard deviation,
    SUM, calculating the sum,
    VARIANCE, calculating the variance.
    5-
    Group functions are mathematical functions to operate on sets of rows to give one result per set.
    6-
    a relationship is formed by correlating rows belonging to different tables. A table relationship is established when a child table defines a Foreign Key column that references the Primary Key column of its parent table.

@Peri7at
Copy link

Peri7at commented Nov 4, 2021

  1. MySQL is DBMS for SQL, which is a language to write queries.
  2. DBMS it is a system for organizing and storing data. The most known types are relational and non-relational.
  3. The most common types of joins are left join, right join and inner join, the other ones are full, cross and self joins.
  • Inner join is to find or create a table that have matching data between two tables
  • LEFT JOIN includes all records from the left side and matched rows from the right table
  • RIGHT JOIN returns all rows from the right side and unmatched rows from the left table
  1. Primary key is a unique column in a record.
  2. There are 6 different types of operators, the most used ones are arithmetic, logic and comparison.
  3. It is needed to filter data based on specific conditions.
  4. Relationship is a connection between entities and the types are 1-1, 1-M, M-1, M-M.

@felmez @emirsagit @yaman3bd

@aycaakyol
Copy link

1.What is the difference between SQL and MySQL?
sql is structured query language which is a special kind of tool to deal with the database
2.What do you mean by DBMS? What are its different types?
DBMS stands for database management systems. It’s a system for storing, retrieving data. Its types are; relational and non-relational database.
3.What are the types of joins in SQL? Give an example for each one.
SQL Server supports many kinds of different joins including INNER JOIN, SELF JOIN, CROSS JOIN, and OUTER JOIN. In fact, each join type defines the way two tables are related in a query.A={1,2,3,3} B ={4,5,6,0,2} So inner join is {2}. Outer join is {0,1,2,2,3,3,4,5,6} Self join for A would be {3}. Cross join would be a cartesian join.
4.What is a Primary key? primary key is the column that contain values that uniquely identify each row in a table
5.What are the different operators available in SQL?
Arithmetic operators (+,- etc),logical operators, bitwise operators,compound, comparison, string
6.What is the need for group functions in SQL?
operate on sets of rows to give one result per set
7.What is a Relationship and what are they?
a relationship is formed by correlating rows belonging to different tables. one-to-one, many-to-many and one-to many are its types

Room 2

@ecelkl
Copy link

ecelkl commented Nov 4, 2021

1.SQL is a language to query databases and MySQL is an an RDBMS. SQL is used to operate manage and access to databases. MySQL allows people to keep the data in a database organized. MySQL uses SQL to query databases. SQL has a standard format since it is a language. MySQL always gets new updates.

  1. DBMS is a computerized data keeping system where users could perform several kinds of operations on that data.
    it has four types main types:
    Hierarchical database
    Network database
    Relational database
    Object-Oriented database

  2. Inner, Outer, Left, Right
    Inner join: return values matches both tables.
    Left join: return all records from the left table and the part matches the right table.
    The following code will select all customers, and any orders they might have:

SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID
ORDER BY Customers.CustomerName;

Right join: return all records from the right table and the part matches the left table.
The following SQL statement will return all employees, and any orders they might have placed

SELECT Orders.OrderID, Employees.LastName, Employees.FirstName
FROM Orders
RIGHT JOIN Employees ON Orders.EmployeeID = Employees.EmployeeID
ORDER BY Orders.OrderID;

Full Outer join: return all values that matches with both table

  1. Primary Key: a column or a group of columns in the table that describes and identifies each row in that table.

  2. 1-Addition: Adding numbers with “+” sign.
    2-Subtraction: Subtracts a number from another with “-” sign.
    3-Multiplication: Multiplies two numbers with “*” sign
    4-Division: Divides one number by another with “/” sign.
    5-Remainder/Modulus:”%” sign returns the remainder from a division.
    6- & (Bitwise AND): “&” symbol compares each bit in a value with its corresponding bit in another value.
    7- &= (Bitwise AND Assignment)
    8- | (Bitwise OR)
    9- |= (Bitwise OR Assignment)
    10- ^ (Bitwise Exclusive OR)
    11- ^= (Bitwise Exclusive OR Assignment)
    12- = (Equal to)
    13- != (Not Equal to)
    14- > (Greater Than)
    15- !> (Not Greater Than)

  3. Group functions are mathematical functions to operate on sets of rows to give one result per set.
    COUNT MAX MIN AVG SUM
    It enables you to group data more clearly and logically, and to summarize data more effectively.

  4. Relationship: relation between tables

Room 8, W/ Amr Nashwaty, Mehmet Fatih Erdem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment