0 votes
91 views
in DataBase Management System by
edited
Er diagraam sql queries

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer

SQL Queries

SQL (Structured Query Language) is a standard language used to manage and manipulate relational databases. Here are some examples of SQL queries:

SELECT statement

SELECT column1, column2, ... FROM table_name;

For example, if you want to retrieve all the columns from a table named "customers", the query would look like this:

SELECT * FROM customers;

WHERE clause

SELECT column1, column2, ... FROM table_name WHERE condition;

For example, if you want to retrieve all the customers who are from New York, the query would look like this:

SELECT * FROM customers WHERE city = 'New York';

JOIN clause

SELECT column1, column2, ... FROM table1 JOIN table2 ON table1.column_name = table2.column_name;

For example, if you have two tables named "orders" and "customers" and you want to retrieve all the orders placed by customers from New York, the query would look like this:

SELECT orders.order_id, orders.order_date, customers.customer_name FROM orders JOIN customers ON orders.customer_id = customers.customer_id WHERE customers.city = 'New York';

ER Diagrams

An ER (Entity-Relationship) diagram is a visual representation of the tables, columns, and relationships in a database. ER diagrams are useful for understanding the structure of a database and for planning and designing new databases. Here are some common symbols used in ER diagrams:

  • Entity: represents a table in the database
  • Attribute: represents a column in a table
  • Relationship: represents a connection between two tables

ER diagrams can be created using various software tools, such as Lucidchart, Microsoft Visio, and MySQL Workbench.

Related questions

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

557 users

...