Docsity

Data and database Assignment, Study Guides, Projects, Research of Database Management Systems (DBMS)

Partial preview of the text

Download Data and database Assignment and more Study Guides, Projects, Research Database Management Systems (DBMS) in PDF only on Docsity!

Database

Sajan Dumaru (HND /First Semester)

\

Contents

Task 1/P Design a relational database system using an appropriate design tools and techniques, containing at least four tables, with clear statements of user and system requirements. Introduction on Database A database is an accumulation of data that is composed with the goal that it can be effortlessly gotten to, overseen and refreshed. Information is sorted out into lines, segments and tables, and it is ordered to make it simpler to discover applicable data. Information gets refreshed, extended and erased as new data is included. Databases process workloads to make and refresh themselves, questioning the information they contain and running applications against it. Introduction on Relational Database A Relational database is a gathering of information things sorted out as an arrangement of formally- depicted tables from which information can be gotten to or reassembled in a wide range of courses without reorganizing the database tables. The standard client and application program interface to a relational database is the Structured query language (SQL). For the relational diagram, there should available information about entity, attributes and relationships. Entity: It is the real-world object. Entity can be either animate or inanimate, that can be easily identifiable.. Here are the entities of the hospital for an example: Patient, Doctor, Ward, Admit and others. Attributes: An attribute is a characteristic. An entity has its own attributes. In one sentence we can say, Attributes are data which defines the characteristics of an object. Example: Patient is an entity whereas name, age, contact, gender and others are the attributes. Relationship: The connection between entity and the attribute is relation. It also helps to know what the actual data is about and helps to know the information. In a context of database, A relationship is a circumstance that exists between two social database tables when one table has an outside key that references the essential key of the other table. We can find many types of relationship. Here are some examples:

  1. One to One : Both tables can have just a single record on either side of the relationship. Every essential key esteem identifies with just a single (or no) record in the related table. They're similar to companions—you could conceivably be hitched, however in the event that you are, both you and your life partner have just a single mate. Most coordinated connections are constrained by business leads and don't stream normally from the information. Without Sajan Dumaru (HND /First Semester)

such a manage, you can for the most part consolidate the two tables into one table without breaking any standardization rules. Example: One patient has one bed. One Patient has only one address. One Patient has only one disease.

  1. One-to-many: The essential key table contains just a single record that identifies with none, one, or numerous records in the related table. This relationship is like the one amongst you and a parent. You have just a single mother, yet your mom may have a few kids. Example: One doctor has many patients.
  2. Many-to-many: Each record in the two tables can identify with any number of records (or no records) in the other table. For example, in the event that you have a few kin, so do your kin (have numerous kin). Many-to-numerous connections require a third table, known as a partner or connecting table, on the grounds that social frameworks can't specifically suit the relationship. Entity relationship diagram (ERD): Sajan Dumaru (HND /First Semester)

Length address aid Int 11 Primary key Auto increment Address id of the person address country Varchar 60 Country of the person address city Varchar 60 City of the person address state Varchar 30 State of residence of the person address zip Varchar 20 Zip code of the area where the person lives admit adid Int 11 Primary key Auto increment Admit id of the admitted person admit pid Int 11 Patient id admit did Int 11 Doctor id admit wid Int 11 Ward id of patient admit admitdate Date Date of admission admit discharge date Date Date of discharge doctor did Int 11 Primary key Auto increment Doctor Id doctor drfname Varchar 30 First name of doctor doctor drlname Varchar 30 Last name of doctor doctor contact Varchar 20 Contact number of doctor doctor gender Varchar 10 Gender of doctor doctor degree Varchar 50 Degree of education of doctor doctor addressid Int 11 Address ID of doctor patient pid Int 11 Primary key Auto increment Patient ID of the patient patient pfname Varchar 40 First name of patient patient plname varchar 40 Last name of patient patient age Int 11 Age of patient patient gender Varchar 12 Gender of patient Sajan Dumaru (HND /First Semester)

patient dob Date Date of birth of patient patient contact Varchar 30 Contact number of patient patient disease varchar 40 Disease of patient patient adrid Int 11 Address ID of the patient ward wid int 11 Primary key Auto increment ward wname varchar 50 ward roomno Int 11 ward bedno Int 11 ward bedcharge Decimal 10, Conclusion From this task, we came to know many knowledge about database and its types. Task 4/P Develop the database system with evidence of user interface, output and data validations and querying across multiple tables. Sajan Dumaru (HND /First Semester)

DCL (Data Control Language) DCL is also one type of language which control the level of access that clients have on database objects. It also includes commands such as granting and for the most part worried about rights, authorizations and different controls of the database framework. GRANT – allows users to read/write on certain database objects REVOKE – keeps users from read/write permission on database objects Constraints A Constraints is an impediment that you put on the information that clients can go into a segment or gathering of segments. A Constraints is a piece of the table definition; you can execute imperatives when you make the table or later. You can expel a Constraints from the table without influencing the table or the information, and you can incidentally impair certain requirements. Constraint is the arrangement of principles that permits what sort of significant worth ought to be utilized as a part of a segment of a table. Limitations confines the kind of information and furthermore it gives precision and dependability of information in table. There are two level utilized as a part of segment level and table level. Section level requirement is utilized as a part of segment and table imperative is utilized for the whole table. Different types of constraints are found so they are described below:

  1. Primary Key: The primary key limitation assigns a section, or a blend of segments, as the essential key for the table. When you put an essential key imperative on a section, you're requiring each line in that segment to have a one of a kind esteem, which can't be NULL. An essential key imperative on different sections requires the blend of qualities in those segments to be one of a kind. Cases of essential keys incorporate receipt number, representative ID, buy arrange number, and thing or part number.
  2. Unique key: The unique key upholds uniqueness in a section or blend of segments. You'd ordinarily utilize it for a hopeful, or surrogate, key—a segment or segments that you could have picked as an essential key, yet didn't. Another illustration is a conveyance benefit putting away drivers' permit numbers, but since two states may have issued a similar number, the organization authorizes the one of a kind mix of state in addition to driver's permit number.
  3. Foreign key: The foreign key characterizes the connection between a section or mix of segments in the present table and a segment or blend of segments in another table. As it were, Sajan Dumaru (HND /First Semester)

it authorizes referential uprightness. This relationship may be balanced, for example, on account of a representative in the finance table who should as of now exist in the workers table. Or then again it could be a many-to-one relationship. The solicitations table may have a few sections for one client.

  1. Default Key: The default key discloses to SQL Server what incentive to put in a section in the event that you don't determine an incentive amid information passage. This requirement applies just to INSERT proclamations; when you're refreshing existing information, it leaves the present esteem (or the NULL) set up. You can have just a single default esteem for each section, and this limitation dependably applies to only one segment. Since it applies just amid INSERT proclamations, you don't have to check existing information when you make the requirement. The default you determine must be of the right information compose and should meet the prerequisites of the check limitations and tenets you've connected.
  2. Check key: The check requirement authorizes space honesty. You can utilize it to guarantee that an entered esteem falls inside an adequate range or takes after a specific example, for example, a phone number or a ZIP or postal code. A table can have different check imperatives. You can even force various conditions on the information in a segment by including in excess of one imperative or by keeping in touch with one complex limitation. You can check existing information when you make the limitation, or you can briefly suspend the check requirement.
  3. Not Null: The Not Null requirement implements a section to NOT acknowledge NULL values. This implements a field to dependably contain an esteem, which implies that you can't embed another record, or refresh a record without increasing the value of this field.
  4. Index: The index proclamation is utilized to make lists in tables. Records are utilized to recover information from the database quick. The clients can't see the lists, they are simply used to accelerate looks/questions. Joins A SQL join is a Structured Query Language (SQL) guideline to combine information from two arrangements of information (i.e. two tables). Before we plunge into the points of interest of a SQL join, we should quickly examine what SQL is, and why somebody would need to play out a SQL join. SQL is an extraordinary reason programming dialect intended for overseeing data in a social Sajan Dumaru (HND /First Semester)

Views: A view is the outcome set of a put away inquiry on the information, which the database clients can question similarly as they would in a tenacious database accumulation protest. This pre-built up question order is kept in the database word reference. Not at all like common base tables in a social database, a view does not shape some portion of the physical blueprint: accordingly set, it is a virtual table figured or gathered progressively from information in the database when access to that view is asked. A view contains the rows and column of one or more table just like a original table. SYNYTAX: CREATE VIEW view_name AS SELECT column1, column2, ... FROM table_name WHERE condition; Query and Screenshot for creating the database table. Sajan Dumaru (HND /First Semester)

The table and query are given below:

  1. Doctor Query: create table doctor( did int AUTO_INCREMENT NOT Null PRIMARY Key, drname varchar(100), drlname varchar(110), contact varchar (90), gender varchar(80), degree VARCHAR(85), address_id int );
  2. Admit: create table admit( adid int AUTO_INCREMENT PRIMARY KEY, pid int, did int, wid int, admitdate date, discharge date );
  3. Ward: create table ward( wid int AUTO_INCREMENT PRIMARY KEY, wname varchar(100), roomno int, bedno int, bedcharge decimal );
  4. Patient: create table Patient( pid int AUTO_INCREMENT PRIMARY KEY, Sajan Dumaru (HND /First Semester)

Introduction: Query language (QL) refers to any computer programming language that solicitations and recovers information from database and data frameworks by sending inquiries. It deals with client entered organized and formal programming summon based questions to discover and separate information from have databases. Inquiry dialect may likewise be named database question dialect. For example, the SQL query: SELECT * FROM Table_Name There are different commands of queries to record the data in the table. They are: INSERT: Insert command is used to insert any data to the table. SYNTAX : INSERT INTO address(country, city, state, zip) VALUES ('USA', 'Chicago','State 1', 010); The syntax insert the data into the address table with column of country, city, state and zip. When the above syntax is written in MySQLSA it will give the following result like below: Now after the query is executed, the row is affected. So, the result is SELECT : Select SYNTAX is used to select or retrieve any data from the database or the table. SYNTAX: SELECT * from address; The above Syntax Selects and views all the data that are saved in the address table. Sajan Dumaru (HND /First Semester)

The above syntax when command on SQL gave following result. UPDATE: Update Syntax is used to change the previous data to new data if there had any wrong on our data. UPDATE address SET country = Japan, city = 'Tokyo’WHERE zip = 20; Sajan Dumaru (HND /First Semester)

DELETE FROM address WHERE country = 'Japan' ; Now after the query is executed, the result is The 2nd^ row had been removed from the given table. By this way, we can use those syntax to insert, delete, update and select. Conclusion With the help of this task, we can learn information about the database about inserting, deleting, updating the datas in the table. Sajan Dumaru (HND /First Semester)

Task 8/P Test the system against user and system requirements. Introduction According to the tutorials point “Software Testing is the process of evaluating a system or its component(s) with the intent to find whether it satisfies the specified requirements or not. Testing is executing a system in order to identify any gaps, errors, or missing requirements in contrary to the actual requirements. This tutorial will give you a basic understanding on software testing, its types, methods, levels, and other related terminologies”. As we know that, there would be error or bugs in software so, to remove those error the software testing is required. There are various types of software testing and in this task I am going to define various types of software testing. Basis of software testing There are two basis of software testing they are black box testing and white box testing. Black Box Testing Black Box Testing is one type of testing strategy where the internal mechanism of a system are ignored and generally mainly focuses in output generated from the selected inputs. This strategy is named so in light of the fact that the product program, according to the analyzer, resembles a black box; inside which one can't see. Black box testing doesn’t uses any specific knowledge of programming code to examine outputs. According to the software testing “Black box testing is also known as Behavioral Testing. Example for it is A tester, without knowledge of the internal structures of a website, tests the web pages by using a browser; providing inputs (clicks, keystrokes) and verifying the outputs against the expected outcome”. Sajan Dumaru (HND /First Semester)