Posts

Relationship(cont........)

Image
Relationships in Database Relationship Relationship is nothing but an association among two or more entities. Entities take part in relationships. We can often identify relationships with verbs or verb phrases. As shown in Fig. 12.1 One-to-One Relationships One-to-Many Relationships Many-to-One Relationships Many-to-Many Relationships Fig. 12.1 Home Previous

Attributes(Cont.............)

Image
Attributes and Relational Data Models in ERP Systems ERP Management System - Attributes and Relational Data Model Attributes Attributes are single-valued properties of either an entity-type or a relationship-type, such as last name, first name, MIS, address, and birth date. Fig. 11.1 Relational Data Model The relational data model provides conceptual tools to design the database schema of a relational database. It describes the data, relationships between that data, data semantics, and constraints on the data in the relational database. Fig. 11.2 Previous Next

ERP Management System Design

Image
ERP Management System Design Design and Develop Conceptual Data Model for an ERP Management System ER Diagram An Entity Relationship Diagram (ERD) displays the relationships of entity sets stored in a database. ER diagrams help explain the logical structure of databases, based on three basic concepts: Entities: Recognizable real-world things, either living or non-living, that are to be represented in the database. Attributes: Properties or details of an entity. Relationships: How entities interact with each other within the system. Enterprise Resource Planning (ERP) ERP is the integrated management of main business processes, often in real time, mediated by software. It is typically a suite of integrated applications that an organization uses to collect, store, manage, and interpret data from many business activities, and can be either local or cloud...

To write and execute SQL queries for the nested and join queries.

Image
SQL Joins and Nested Queries SQL Joins and Nested Queries A join clause is used to combine rows from two or more tables, based on a related column between them. Here are the different types of the JOINs in SQL: (INNER) JOIN: Returns records that have matching values in both tables. LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table. RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table. FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table. CARTESIAN JOIN or CROSS JOIN: There is a join for each row of one table to every row of another table. This usually happens when the matching column or WHERE condition is not specified. SELF JOIN: A table is joined to itself, meaning each row of the table is joined with itself and all other rows depending on ce...

Use of substring functions.

Image
Use of SUBSTRING Function Use of Substring Functions The SUBSTRING function in SQL allows extraction of a specified portion of a string based on the user's requirements. This function is commonly used to manipulate and retrieve parts of string data from database fields. Syntax for SUBSTRING() SUBSTRING(Expression, Starting Position, Length) The parameters are as follows: Expression: The string expression from which to extract the substring. Starting Position: The starting index from which to begin extraction, where the first character in the string is 1. Length: The number of characters to extract from the string starting from the Starting Position. QUERY to Create Table CREATE TABLE team(name VARCHAR(90), address VARCHAR(50), phone_no INT, age INT); As shown in Fig. 8.1: Fig. 8.1 QUERY to Extract Substring SELECT SUBSTRING(name, 1, 3) AS ExtractedString FROM team; Previous Next

Use of order by statement.

Image
Use of ORDER BY Statement Use of order by statement The ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword. Syntax* SELECT column1, column2, ... FROM table_name ORDER BY column1, column2, ... ASC|DESC; QUERY* CREATE TABLE stud_113 (Rollno NUMBER(5), name VARCHAR(10), address VARCHAR(15), phoneno NUMBER(10), age NUMBER(5)); As Shown in Fig...7.1 Output Fig... 7.1 QUERY* INSERT INTO stud_113 VALUES(3); INSERT INTO stud_113 VALUES(2); INSERT INTO stud_113 VALUES(5); INSERT INTO stud_113 VALUES(4); INSERT INTO stud_113 VALUES(1); INSERT INTO stud_113 VALUES(6); As Shown in Fig...7.2 Output Fig... 7.2 QUERY* SELECT * FROM stud_113 ORDER BY rollno DESC; As Shown in Fig...7.3 Output Fig... 7.3 Previous Next

Use of Aggregate Functions (Cont........)

Image
Use of Aggregate Functions (Cont...) Use of Aggregate Functions (Cont...) QUERY* select count(distinct Company_name) from Product; As Show Fig...6.1 Output Fig... 6.1 QUERY* select company_name, count(*) from product group by company_name; As Show Fig...6.2 Output Fig... 6.2 QUERY* select MAX(quantity) from Product; As Show Fig...6.3 Output Fig... 6.3 QUERY* select MIN(quantity) from Product; As Show Fig...6.4 Output Fig... 6.4 Previous Next