Download Cardinality in ER Diagram and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity! CARDINALITY Presented By Nidhi Singh COURSE OUTCOME • TO UNDERSTAND DEGREE OF RELATIONSHIP • TO UNDERSTAND TYPE OF RELATIONSHIP • HOW TO REDUCE THE TABLE RELATIONSHIP TABLE • WHAT ATTRIBUTES WILL RELATIONSHIP TABLE CONTAIN? • HOW HAVE YOU PUT THE VALUE INSIDE RELATIONSHIP TABLE ? • WHAT IS PRIMARY KEY? • CAN I REDUCE THE TABLE? E_ID E_NAME AGE D_ID 1 ANIL 24 D1 2 SUNIL 27 D2 3 RITIKA 25 D3 4 SIMITA 28 D4 ONE TO MANY CUSTOMER ORDERGIVEN O_NUM ITEM_NAME COST D1 PASTA 128 D2 BURGER 234 D3 PIZZA 250 D4 SPRING ROLL 110 ID_NAME NAME CITY 1 ANIL PUNE 2 SUNIL DELHI 3 RITIKA NOIDA 4 SIMITA JAIPUR ID_NAM E O_NUM DATE 1 D1 11/2/21 1 D2 30/3/20 2 D3 15/2/21 2 D4 22/3/20 ONE TO MANY • WHAT ATTRIBUTES WILL RELATIONSHIP TABLE CONTAIN? • HOW HAVE YOU PUT THE VALUE INSIDE RELATIONSHIP TABLE ? • WHAT IS PRIMARY KEY? • CAN I REDUCE THE TABLE? • Note: Attribute of relationship table called descriptive attribute ID_NAME O_NUM DATE ITEM_NAME COST 1 D1 11/2/21 PASTA 128 1 D2 30/3/20 BURGER 234 2 D3 15/2/21 PIZZA 250 2 D4 22/3/20 SPRING ROLL 110 HOW MANY TABLES WILL FORM ? E1 E2 R1 R2 A B • CREATE THE TABLE EMPLOYEE • INSERT ATTRIBUTE • EMP_ID • FIRST_NAME • LAST_NAME • E_MAIL • PHONE_NUM • HIRE_DATE • JOB_ID • SALARY • DEPARTMENT_ID • MANAGER_ID 1. Write a query in SQL to display the full name (first and last name), and salary for those employees who earn below 6000. 2. Write a query in SQL to display the first and last name, and department number for all employees whose last name is “SINGH” 3. Write a query in SQL to display display all the information for all movies who have the letters M in movie title • SELECT movie_title, movie_year, movie_lang • FROM Movies • WHERE movie_title LIKE 'M%';