Acknowledgement All praise and blessing are due to the creator of mankind and all that exists, for His blessings, and guidance at every stage of my life. For the successful completion of this assignment, I needed the help and guidelines of some respected person, who deserves my greatest gratitude. The completion of this assignment gives me much pleasure. I wish to thank the officials and other staff members of ESOFT who rendered their help during the period of my study. Thank you. Yours’s sincerely, M. R. M Aashiq Yohan HND Computing. M. R. M Aashiq Yohan - JH55564 DAD 1 Table of Contents TASK 01 .................................................................................................................................. 4 1.1. Comparison of different Data Models .......................................................................... 8 1.2. Power point presentation of the benefits and limitation of the different database technologies ........................................................................................................................... 13 1.3. Analyze the different approaches of the Database design. ......................................... 20 TASK 02 ................................................................................................................................ 22 2.1. Entity Relationship Diagram of Stafford University .................................................. 22 2.2. Translate the ER diagram into Relational schemas .................................................... 23 2.3. Design a RDBMS according to the ER diagram ........................................................ 24 2.4. Evidence of the use of a suitable IDE to create a simple interface ............................ 27 TASK 03 ................................................................................................................................ 42 3.1. Explain the benefit of different manipulation and query tools ................................... 42 3.2. Perform below SQL queries to provide an output from the tables of Stafford University 49 3.3. Critically evaluate how different query tools can be used to obtain meaningful data with its unique functionalities ............................................................................................... 52 TASK 04 ................................................................................................................................ 56 4.1. Test Plan ..................................................................................................................... 56 4.2. Test Cases ................................................................................................................... 57 4.3. User Documentation ................................................................................................... 60 4.4. Provide evidences on how to address verification and validation .............................. 61 M. R. M Aashiq Yohan - JH55564 DAD 2 4.5. Control mechanism and Security Database ................................................................ 63 Conclusion ............................................................................................................................. 68 Reference ............................................................................................................................... 69 Picture reference .................................................................................................................... 71 Gantt chart ............................................................................................................................. 73 M. R. M Aashiq Yohan - JH55564 DAD 3 Table of Contents Figure 1 .................................................................................................................................... 8 Figure 2 .................................................................................................................................... 9 Figure 3 .................................................................................................................................. 10 Figure 4 .................................................................................................................................. 10 Figure 5 .................................................................................................................................. 11 Figure 6 .................................................................................................................................. 11 Figure 7 .................................................................................................................................. 12 Figure 8 .................................................................................................................................. 12 Figure 9 .................................................................................................................................. 13 Figure 10 ................................................................................................................................ 13 Figure 11 ................................................................................................................................ 14 Figure 12 ................................................................................................................................ 14 Figure 13 ................................................................................................................................ 15 Figure 14 ................................................................................................................................ 15 Figure 15 ................................................................................................................................ 16 Figure 16 ................................................................................................................................ 16 Figure 17 ................................................................................................................................ 17 Figure 18 ................................................................................................................................ 17 Figure 19 ................................................................................................................................ 18 Figure 20 ................................................................................................................................ 18 Figure 21 ................................................................................................................................ 19 Figure 22 ................................................................................................................................ 22 M. R. M Aashiq Yohan - JH55564 DAD 4 Figure 23 ................................................................................................................................ 23 Figure 24 ................................................................................................................................ 24 Figure 25 ................................................................................................................................ 24 Figure 26 ................................................................................................................................ 24 Figure 27 ................................................................................................................................ 25 Figure 28 ................................................................................................................................ 25 Figure 29 ................................................................................................................................ 25 Figure 30 ................................................................................................................................ 26 Figure 31 ................................................................................................................................ 26 Figure 32 ................................................................................................................................ 28 Figure 33 ................................................................................................................................ 29 Figure 34 ................................................................................................................................ 29 Figure 35 ................................................................................................................................ 30 Figure 36 ................................................................................................................................ 30 Figure 37 ................................................................................................................................ 46 Figure 38 ................................................................................................................................ 47 Figure 39 ................................................................................................................................ 49 Figure 40 ................................................................................................................................ 49 Figure 41 ................................................................................................................................ 50 Figure 42 ................................................................................................................................ 50 Figure 43 ................................................................................................................................ 50 Figure 44 ................................................................................................................................ 51 Figure 45 ................................................................................................................................ 51 Figure 46 ................................................................................................................................ 51 M. R. M Aashiq Yohan - JH55564 DAD 5 Figure 47 ................................................................................................................................ 52 Figure 48 ................................................................................................................................ 52 Figure 49 ................................................................................................................................ 53 Figure 50 ................................................................................................................................ 53 Figure 51 ................................................................................................................................ 54 Figure 52 ................................................................................................................................ 54 Figure 53 ................................................................................................................................ 55 Figure 54 ................................................................................................................................ 55 Figure 55 ................................................................................................................................ 60 Figure 56 ................................................................................................................................ 67 Figure 57 ................................................................................................................................ 73 M. R. M Aashiq Yohan - JH55564 DAD 6 List of Table Table 1 ................................................................................................................................... 56 Table 2 ................................................................................................................................... 57 Table 3 ................................................................................................................................... 58 Table 4 ................................................................................................................................... 59 M. R. M Aashiq Yohan - JH55564 DAD 7 TASK 01 1.1. Comparison of different Data Models A database is basically a repository of data which is devised in order to support efficient data storage. In addition to data storage, a database also assists in retrieval and maintenance of data stored in it. There are many different types of databases. A database holds data and assists in making it reachable through various ways. A database is known for its regular and systematically defined structure. Some important characteristics of databases are • Concurrent use – Many users can access the database concurrently • Structured and described data – In addition to data, it also consists of complete definition and description of data • Separation of Data and Applications – Due to this feature it is not required for application software to known about the physical data storage. • Data Integrity – Data remains protected from the unauthorized access and changes • Transactions – It refers to the features which maintains the atomicity; which means a consistent state. • Data Persistence – It refers to the durability of the data which must not be dependent on any of the system features Figure 1 M. R. M Aashiq Yohan - JH55564 DAD 8 Generally, databases can be categorized on the basis of number of users, location, form of data saved in it, etc. Generally, all of the databases fall in one of these models. Document Oriented Database – This database is free from any type of strict schema. It does not store data in the form of data table, but in the form of text records. This type of database is suitable for storing dynamic data. CouchDB and Raven DB are examples of document databases. It is useful for an application which is document-based. Documents are encoded using some standard formats . Figure 2 Embedded Database – An embedded database runs within an application, and therefore it does not run as a separate application. Unlike general purpose databases, this database is embedded as in line code or linked library. It saves time wasted on issues related to installations or maintenance. These types of databases are generally found in the set-top boxes, mobile phones, etc. RDM server and RDM Embedded are examples of these types of databases M. R. M Aashiq Yohan - JH55564 DAD 9 Figure 3 Graph Database – It is based on the relationship of resources with each other, and no particular resourse has any essential importance on the other. These types of graphs help in storing data for a dynamic schema. It provides index free adjancy. In this graph database, each vertex works as a mini index for its adjacent elements. Infogrid type of graph database should be preferred for model flexibility. Figure 4 M. R. M Aashiq Yohan - JH55564 DAD 10 Hypertext Database – These types of databases are used for organizing a large sum of dissimilar information. The type of information is not devised for carrying out numerical analysis. An object is linked with any other object in a hypertext type of database. This kind of database system was invented by Ted Nelson. They are preferred for maintaining online encyclopedias. Unlike traditional databases, it has no regular structure, and therefore the user can reach to the desired information through different ways. Figure 5 Operational Database – It contains data related to the operations going on in an organization or enterprise. Some of the main information it contains are regarding information of employees, data describing transactions, etc. This type of database is updated regularly. It works on the same approach as OLTP. The focus of this database is to record current data. It is often differentiated with the data warehouse. Figure 6 M. R. M Aashiq Yohan - JH55564 DAD 11 Distributed Database - It consists of a set of databases which are located on different computers, but all these data bases work as one database logically. Therefore, the data can be accessed and modified simultaneously with the help of a network. It is controlled by a local DBMS. It is important to maintain consistency while dealing with this type of arrangement. Figure 7 Flat-File Database – These are data files in which records hold no structured relationship. Additional information is often required for understanding or interpreting these files. In simple language, if we have one table in a database, it will be referred to as a flat file database. It is useful for storing a small amount of records. A spreadsheet application like Excel works as a flat file database. Figure 8 M. R. M Aashiq Yohan - JH55564 DAD 12 1.2. Power point presentation of the benefits and limitation of the different database technologies Figure 9 Figure 10 M. R. M Aashiq Yohan - JH55564 DAD 13 Figure 11 Figure 12 M. R. M Aashiq Yohan - JH55564 DAD 14 Figure 13 Figure 14 M. R. M Aashiq Yohan - JH55564 DAD 15 Figure 15 Figure 16 M. R. M Aashiq Yohan - JH55564 DAD 16 Figure 17 Figure 18 M. R. M Aashiq Yohan - JH55564 DAD 17 Figure 19 Figure 20 M. R. M Aashiq Yohan - JH55564 DAD 18 Figure 21 M. R. M Aashiq Yohan - JH55564 DAD 19 1.3. Analyze the different approaches of the Database design. There are essentially two different approaches one can take when designing databases; these, from a high-level analytic point of view, narrow down to what are typically called “Topdown” and “Bottom-up” philosophies or methods. While these methodologies can appear profoundly unique, they share the shared objective of joining a system by portraying the greater part of the association between the procedures. Top-down Top-down design, is characterized by an extensive planning and research phase that leads into the development of the database (Maxey, 2012). This is commonly used when first creating a database as a high-level view of the entire database with all requirements are often known. Advantages: • A high-level view of all components. • Full visibility of what effect any change has on the entire database and relationships. • More coherent, with less redundancy and fewer ways of doing things (Brower, 2015). • Specify requirements without worrying about implementation. Disadvantages: • Quite a timely approach by comparison to Bottom-up. • More communication is required between the designer and end-user of the database. M. R. M Aashiq Yohan - JH55564 DAD 20 Bottom-up The Bottom-up approach starts with the particular points of interest and climbs to the general, higher level views later down the line. To start a bottom-up plan, the designer will assess every one of the interfaces that the database has, checking tables, relationships and views. The designer will work in reverse through the database to figure out what information ought to be stored in the database and how (Burleson, n.d.). This is commonly used when a database already exists but needs changes, new relationships or some sort of schema adjustment. Advantages: • Can quickly get something working and in operation. • Critical modules tend to be designed and implemented early on. Disadvantages: • Do not always see the high-level view of what a change can potentially affect. • Likely more time spent due to requirements needing to be fleshed out a little more. I personally like to use a combination of the two, with the beginning of a project favoring the Top-down approach with all amendments being undertaken with the Bottom-up approach; however, I do believe that one should design the database to fit the data, not the application. This important as one can get bogged down with implementation technicalities quite easily early on, when all you should really be focusing on is the best way to store and retrieve the data in the fastest and less duplicative way possible. M. R. M Aashiq Yohan - JH55564 DAD 21 TASK 02 2.1. Entity Relationship Diagram of Stafford University Figure 22 M. R. M Aashiq Yohan - JH55564 DAD 22 2.2. Translate the ER diagram into Relational schemas Figure 23 M. R. M Aashiq Yohan - JH55564 DAD 23 2.3. Design a RDBMS according to the ER diagram Figure 24 Figure 25 Figure 26 M. R. M Aashiq Yohan - JH55564 DAD 24 Figure 27 Figure 28 Figure 29 M. R. M Aashiq Yohan - JH55564 DAD 25 Figure 30 Figure 31 M. R. M Aashiq Yohan - JH55564 DAD 26 2.4. Evidence of the use of a suitable IDE to create a simple interface Visual studio 2012 Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs, as well as web sites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a code profiler, forms designer for building GUI applications, web designer, class designer, and database schema designer. It accepts plug-ins that enhance the functionality at almost every level— including adding support for source control systems (like Subversion and Git) and adding new toolsets like editors and visual designers for domain-specific languages or toolsets for other aspects of the software development lifecycle (like the Team Foundation Server client: Team Explorer). Visual Studio supports 36 different programming languages and allows the code editor and debugger to support (to varying degrees) nearly any programming language, provided a language-specific service exists. Built-in languages include C,[6] C++, C++/CLI, Visual Basic .NET, C#, F#,[7] JavaScript, TypeScript, XML, XSLT, HTML and CSS. Support for other languages such as Python,[8] Ruby, Node.js, and M among others is available via plugins. Java (and J#) were supported in the past. M. R. M Aashiq Yohan - JH55564 DAD 27 Below are some user interfaces and the codes in my solution. Figure 32 M. R. M Aashiq Yohan - JH55564 DAD 28 • Add student Figure 33 • View student Figure 34 M. R. M Aashiq Yohan - JH55564 DAD 29 • Search student Figure 35 • Edit student Figure 36 M. R. M Aashiq Yohan - JH55564 DAD 30 Codes using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.SqlClient; namespace DAD_system { public partial class Form1 : Form { public Form1() { InitializeComponent(); } int id = 0; // Declare the variable for global purposes. private void Form1_Load(object sender, EventArgs e) { try { M. R. M Aashiq Yohan - JH55564 DAD 31 // Load the student details into the data grid view on startup and arrange the aligns. dgv.AutoResizeColumns(); dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; LoadDataGridView(); } catch (Exception) { MessageBox.Show("Error on loading"); ; } } private void button2_Click(object sender, EventArgs e) { deletefunction(); // Call the delete function. LoadDataGridView(); // Reload the data grid view after the deletion. } private void btnclr_Click(object sender, EventArgs e) { // Clear and reset the input fields. txtname.Clear(); txtaddress.Clear(); } M. R. M Aashiq Yohan - JH55564 DAD 32 private void btnsave_Click(object sender, EventArgs e) { savefunction(); // Call the save function. } private void savefunction() { try { if (txtname.Text != "" && txtaddress.Text != "" ) { // Insert the data into the table. SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E: DO\DAD\DAD system\DAD system\sudatabase.mdf;Integrated Security=True;Connect Timeout=30"); con.Open(); string query = "insert into student (STUDENTNAME,ADDRESS) values ('" +txtname.Text + "','" + txtaddress.Text + "') "; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show("Successfully Saved"); con.Close(); txtname.Clear(); txtaddress.Clear(); LoadDataGridView(); } M. R. M Aashiq Yohan - JH55564 DAD 33 else { MessageBox.Show("Please fill up the details"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } // Update the Student details. private void updatefunction() { try { string name = txtname.Text; string address = txtaddress.Text; editfuntion(); //Update query for update the details in existing records. string query = "update STUDENT set STUDENTNAME ='" + name + "', ADDRESS = '" + address + "' where STUDENTID =" + id; SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E: \DO\DAD\DAD system\DAD M. R. M Aashiq Yohan - JH55564 DAD 34 system\sudatabase.mdf;Integrated Security=True;Connect Timeout=30"); SqlCommand cmd = new SqlCommand(query, con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("Successfully Updated"); LoadDataGridView(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } // Edit the new Student details. private void editfuntion() { try { int studdentid = 0; if (txtsearch.Text != "") { M. R. M Aashiq Yohan - JH55564 DAD 35 //Fetch the records and load into the input fields. SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E: \DAD\DAD system\DAD system\sudatabase.mdf;Integrated Security=True;Connect Timeout=30"); con.Open(); string query = "select * from STUDENT where STUDENTID = " + txtsearch.Text; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { studdentid = int.Parse(reader["sid"].ToString()); txtname.Text = reader.GetString(1); id = studdentid; // Initialize the id ( Global variable ). Search_data_grid_view(); // Search and Highlight the result row. } MessageBox.Show("No Records Found", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); con.Close(); M. R. M Aashiq Yohan - JH55564 DAD 36 } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } // Delete the Student details private void deletefunction() { try { editfuntion(); // Call the edit function for load the particular records into the input fields. if (txtsearch.Text != "") { //Query for delete the particular record with id. SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E: TO DO\DAD\DAD system\DAD system\sudatabase.mdf;Integrated Security=True;Connect Timeout=30"); con.Open(); string query = "delete from STUDENT where STUDENTID =" + txtsearch.Text; M. R. M Aashiq Yohan - JH55564 DAD 37 if (DialogResult.Yes == MessageBox.Show("Are you sure want to delete ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { MessageBox.Show("Successfully Deleted"); SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); con.Close(); } } LoadDataGridView(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } private void LoadDataGridView() { try { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=E: DO\DAD\DAD system\DAD system\sudatabase.mdf;Integrated Security=True;Connect Timeout=30"); M. R. M Aashiq Yohan - JH55564 DAD 38 string query = "select * from student"; SqlDataAdapter adp = new SqlDataAdapter(query, con); DataTable dt = new DataTable(); con.Open(); adp.Fill(dt); con.Close(); dgv.DataSource = dt; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } // Seacrh and highlight row in data grid view. private void Search_data_grid_view() { String searchValue = txthidden.Text; int rowIndex = -1; dgv.ClearSelection(); foreach (DataGridViewRow row in dgv.Rows) { if (row.Cells[0].Value.ToString().Equals(searchValue)) { M. R. M Aashiq Yohan - JH55564 DAD 39 rowIndex = row.Index; dgv.CurrentCell = dgv.Rows[rowIndex].Cells[0]; break; } } dgv.Rows[rowIndex].Selected = true; } private void btnupdate_Click(object sender, EventArgs e) { updatefunction(); // Call the update fucntion. LoadDataGridView(); // Reload the data grid view after the updation. } private void btnedit_Click(object sender, EventArgs e) { editfuntion(); // Call the edit function. } private void toolStripButton2_Click_1(object sender, EventArgs e) { Application.Exit(); // Exit the application. } private void toolStripButton1_Click_1(object sender, EventArgs e) { help hp = new help(); hp.ShowDialog(); } M. R. M Aashiq Yohan - JH55564 DAD 40 private void txtsearch_TextChanged(object sender, EventArgs e) { Search_data_grid_view(); } private void Form1_Load_1(object sender, EventArgs e) { LoadDataGridView(); } M. R. M Aashiq Yohan - JH55564 DAD 41 TASK 03 3.1. Explain the benefit of different manipulation and query tools SQL INSERT INTO Statement • The INSERT INTO statement is used to add new data to a database. • The INSERT INTO statement adds a new record to a table. • INSERT INTO can contain values for some or all of its columns. • INSERT INTO can be combined with a SELECT to insert records. The SQL INSERT INTO syntax INSERT INTO table-name (column-names) VALUES (values) Problem: Add a record for a new table INSERT INTO Customer (FirstName, LastName, City, Country, Phone) VALUES ('Craig', 'Smith', 'New York', 'USA', 1-01-993 2800) M. R. M Aashiq Yohan - JH55564 DAD 42 SQL UPDATE Statement • The UPDATE statement updates data values in a database. • UPDATE can update one or more records in a table. • Use the WHERE clause to UPDATE only specific records. The SQL UPDATE syntax UPDATE table-name SET column-name = value, column-name = value, ... To limit the number of records to UPDATE append a WHERE clause: UPDATE table-name SET column-name = value, column-name = value, ... WHERE condition M. R. M Aashiq Yohan - JH55564 DAD 43 SQL DELETE Statement • DELETE permanently removes records from a table. • DELETE can delete one or more records in a table. • Use the WHERE clause to DELETE only specific records. The SQL DELETE syntax DELETE table-name To delete specific records, append a WHERE clause: DELETE table-name WHERE condition SQL SELECT Statement • The SELECT statement retrieves data from a database. • The data is returned in a table-like structure called a result-set. • SELECT is the most frequently used action on a database. M. R. M Aashiq Yohan - JH55564 DAD 44 The SQL SELECT syntax SELECT column-names FROM table-name To select all columns, use SELECT * FROM table-name SQL WHERE LIKE Statement • WHERE LIKE determines if a character string matches a pattern. • Use WHERE LIKE when only a fragment of a text value is known. • WHERE LIKE supports two wildcard match options: % and _. The SQL WHERE LIKE syntax SELECT column-names FROM table-name WHERE column-name LIKE value M. R. M Aashiq Yohan - JH55564 DAD 45 Optional Wildcard characters allowed in 'value' are % (percent) and _ (underscore). A % matches any string with zero or more characters. SQL JOIN • An SQL JOIN combines records from two tables. • A JOIN locates related column values in the two tables. • A query can contain zero, one, or multiple JOIN operations. • INNER JOIN is the same as JOIN; the keyword INNER is optional. Figure 37 Different types of JOINs • (INNER) JOIN: Select records that have matching values in both tables. • LEFT (OUTER) JOIN: Select records from the first (left-most) table with matching right table records. • RIGHT (OUTER) JOIN: Select records from the second (right-most) table with matching left table records. • FULL (OUTER) JOIN: Selects all records that match either left or right table records. M. R. M Aashiq Yohan - JH55564 DAD 46 Figure 38 The SQL JOIN syntax SELECT column-names FROM table-name1 JOIN table-name2 ON column-name1 = column-name2 WHERE condition M. R. M Aashiq Yohan - JH55564 DAD 47 The general syntax with INNER is: SELECT column-names FROM table-name1 INNER JOIN table-name2 ON column-name1 = column-name2 WHERE condition M. R. M Aashiq Yohan - JH55564 DAD 48 3.2. Perform below SQL queries to provide an output from the tables of Stafford University • Display the details of students who have awarded by a grade with particular lecturer’s ID and the lecturer’s name using Join queries. Figure 39 Figure 40 M. R. M Aashiq Yohan - JH55564 DAD 49 • Delete all the details of the students who have not achieved a PASS grade. Figure 41 Figure 42 Figure 43 M. R. M Aashiq Yohan - JH55564 DAD 50 • Update query with the help of Join queries to update a particular record in the database. Figure 44 Figure 45 Figure 46 M. R. M Aashiq Yohan - JH55564 DAD 51 3.3. Critically evaluate how different query tools can be used to obtain meaningful data with its unique functionalities I used 2 tables to explain the query tools. 1. Faculty table 2. Supervisor table Figure 47 Figure 48 M. R. M Aashiq Yohan - JH55564 DAD 52 The SQL WHERE Clause The WHERE clause is used to filter records. The WHERE clause is used to extract only those records that fulfill a specified condition. WHERE Syntax SELECT column1, column2, ... FROM table_name WHERE condition; Figure 49 Figure 50 M. R. M Aashiq Yohan - JH55564 DAD 53 The SQL ORDER BY Keyword 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. ORDER BY Syntax SELECT column1, column2, ... FROM table_name ORDER BY column1, column2, ... ASC|DESC; Figure 51 Figure 52 M. R. M Aashiq Yohan - JH55564 DAD 54 The SQL SELECT DISTINCT Statement The SELECT DISTINCT statement is used to return only distinct (different) values. Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values. The SELECT DISTINCT statement is used to return only distinct (different) values. SELECT DISTINCT Syntax SELECT DISTINCT column1, column2, ... FROM table_name; Figure 53 Figure 54 M. R. M Aashiq Yohan - JH55564 DAD 55 TASK 04 4.1. Test Plan Test Description Test steps Expected output Edit function Enter ID and click edit Profile updated Enter ID and click Profile deleted ID 01 02 Delete student delete 03 Check Help button click Help form should open Table 1 M. R. M Aashiq Yohan - JH55564 DAD 56 4.2. Test Cases Test Case ID 01 Description Edit function Test Steps Enter ID and click edit Expected Result Profile updated Actual Result Profile updated Before Screenshot After Status Pass Table 2 M. R. M Aashiq Yohan - JH55564 DAD 57 Test Case ID 02 Description Delete student Test Steps Enter ID and click delete Expected Result Profile deleted Actual Result Profile deleted Before Screenshot After Status Pass Table 3 M. R. M Aashiq Yohan - JH55564 DAD 58 Test Case ID 03 Description Check Help button Test Steps Click Expected Result Help form should open Actual Result Help form opened Screenshot Status Pass Table 4 M. R. M Aashiq Yohan - JH55564 DAD 59 4.3. User Documentation Help menu to assist the User Figure 55 M. R. M Aashiq Yohan - JH55564 DAD 60 4.4. Provide evidences on how to address verification and validation Verification Software Engineering standards known as IEEE-STD-610 defines “Verification” as: “A test of a system to prove that it meets all its specified requirements at a particular stage of its development.” The last phrase of the definition, “at a particular stage of its development” is the key part of verification. Before coding begins on any application, a set of specifications will have been outlined. The verification of development refers to checking application that is still being developed to ensure that it adheres to these specifications. These checks could be something as simple as reading the specifications and comparing them against the code logic to make sure they line up. The verification process will include activities like code reviews, walkthroughs, inspections but little, if any, actual testing. Consider someone driving to a distant location using directions. Those directions would be regularly checked and compared against the various landmarks along the route. For example, head west until you cross the river, turn north at the store and so forth. With instructions like this, the driver is verifying the route against the directions that were provided. Here’s another example. During the development of a spreadsheet, the basic mathematical functions need to be verified that their individual calculations are accurate before they can be applied to more complex code and eventually formulas. This type of testing is done alongside of the development to ensure that each new step meets the predefined specifications. The value of verification testing is realized when development is complete, and the application functions as expected. This type of testing helps to shift the identification and resolution of any bugs further left (earlier on in the application lifecycle). This means significant cost and time savings on the overall project. The reasoning is simple – it is far easier and more efficient to fix a small bug M. R. M Aashiq Yohan - JH55564 DAD 61 as it’s created, than later on when hundreds of lines of code have to be searched to find the same issue. Validation Validation, on the other hand, is quite different and serves a very different purpose. The definition of Validation according to IEEE-STD-610 is: “An activity that ensures that an end product stakeholder’s true needs and expectations are met.” Whereas verification takes place while the product is still under development, validation is performed upon the completion of a given module, or even the completion of the entire application. Validation focuses on ensuring that the stakeholder gets the product they wanted. The Validation effort doesn’t care how you got there, only that you have arrived, and that everything is as expected. Going back to our example of the driver: if your planned destination was the beach, to validate your arrival at this location, you might ask some questions: • Can I feel sand underfoot? • Can I see the ocean and waves? • Does this location meet my expectation of a beach? These type of validation tests ensures only that your current location meets your expected criteria. Using our example of creating a spreadsheet, once the development of the spreadsheet is complete, we would run validation tests to ensure that the finished product will meet the needs of the customer. This is high level testing and typically consists of regression testing, user testing, performance testing and so on. M. R. M Aashiq Yohan - JH55564 DAD 62 4.5. Control mechanism and Security Database Security Policies Security policies are guidelines describing all (if possible) actions pertinent to the information system. Logical access control belongs to that area and so security policies should define principles on which is design of secure DBMS based. Generally, policies should give answers on basic security questions. Policies can be divided into two basic types - of minimal (army) and maximal (university) privilege. System with such a policy is called closed or opened, respectively. Talking about access control, the way of administration of access rules should be determined. • hierarchical decentralized - central authorizer distributes responsibilities among dependent sub authorizers • ownership based - owner of an object (its author) determines access to the object • cooperative authorization - authorization of special rights for special resources is approved by all members of predefined group Security Mechanisms In the moment when politics are defined, mechanisms that fulfill them can be selected. Mechanisms are external: • administrative controls • physical controls and internal that are part of information system itself: M. R. M Aashiq Yohan - JH55564 DAD 63 • authentication - user identity is verified; this process is based on knowledge of something, ownership of an object or on physical characteristics of user • authorization - system answers only those queries that user is authorized for (access control) • audit - is composed from two phases; logging of actions in the system and reporting of logged information Security Threat This word has been used several times already. Security threat is any hostile agent which randomly or with use of specialized techniques can obtain or change information in the information system. Random security threats are: • natural or accidental disasters- earthquake, water damage or fire. As data as hardware is damaged which leads to the integrity violence and service rejection. • errors and bugs in hardware and software - causes improper application of security policies. • human errors - unintentional violations such as incorrect input or wrong use of applications. Intended security threats can be categorized according to their originator: • authorized users - abuse their privileges • hostile agents - various hostile programs - viruses, Trojan horses, back-doors M. R. M Aashiq Yohan - JH55564 DAD 64 Requirements on DBMS Security At this moment we have basic image of information system security and we can take a look at concrete aspects that should be covered with DBMS security mechanisms. 1. Protection from improper access- only authorized users should be granted access to objects of DBMS. This control should be applied on smaller objects (record, attribute, value). 2. Protection from inference - inference of confidential information from available data should be avoided. This regards mainly statistical DBMSs. 3. Database integrity - partially is ensured with system controls of DBMS (atomic transactions) and various back-up and recovery procedures and partially with security procedures. 4. Operational data integrity - logical consistence of data during concurrent transactions (concurrency manager), serializability and isolation of transactions (locking techniques). 5. Semantic data integrity - ensuring that attribute values are in allowed ranges. This is ensured with integrity constraints. 6. Accountability and auditing - there should be possibility to log all data accesses. 7. User authentication - there should be unambiguous identification of each DBMS user. This is basis for all authorization mechanisms. 8. Management and protection of sensitive data - access should be granted only to narrow round of users. 9. Multilevel security - data may be classified according to their sensitivity. Access granting should then depend on that classification. 10. Confinement (subject isolation) - there is necessity to isolate subjects to avoid uncontrolled data flow between programs (memory channels, covert channels). M. R. M Aashiq Yohan - JH55564 DAD 65 At least five aspects from the previous list must be ensured with special techniques that do not exist in unsecure DBMSs. There are three basic ways to do it: • flow control - we control information flows in frame of DBMS • inference control - control of dependencies among data • access control - access to the information in DBMS is restricted Cryptographic techniques can be added to the controls. Flow Control Flow control regulates distribution (flow) of information among available objects. E.g. reading of information from object X and its direct writing into object Y. Flow control policies need list of acceptable information flows and their constrains. Flow constraints are often based on classification of system elements and definition of acceptable flows between classification levels. Inference Control The aim of the inference control is to avoid indirect disclosure of information (set of data X that can be read by user can be used for determination of data set Y (Y=f(X)) ). Generally, there are three ways to unauthorized data disclosure: 1. correlated data - typical channel when visible data X are semantically related with invisible data Y 2. missing data - result of query contains NULL values that mask sensitive data. Existence of that data may by detected that way. 3. statistical inference - typical for databases that provide statistical information about entities. Statistical databases do not allow direct access to data and user has to query only statistical data. Attacks in this DBMSs can be faced with two different approaches: M. R. M Aashiq Yohan - JH55564 DAD 66 1. data perturbation - concrete data are replaced with statistical results 2. query controls - more frequently used, mostly it is based on minimal and maximal number of items that are concerned with query. Results are satisfactory but this technique is expensive and difficult for administration. Access Control Access control is responsible for control of rules determined by security policies for all direct accesses to the system. Traditional control systems work with notions subject, object and operation. Figure 56 M. R. M Aashiq Yohan - JH55564 DAD 67 Conclusion Stafford University is a large institution which provides education to vast number of students. The University consists of a number of faculties, such as the Art Faculty, the Science Faculty, and so on. Each faculty has a name, dean and building. Each faculty offers different programs and each program can be offered by only one faculty. Each program has a unique code, title, level and duration. Some programs may have one or more prerequisite courses and one course can be the prerequisite course of some other courses. I create a database for the college. Thank you M. R. M Aashiq Yohan - JH55564 DAD 68 Reference searchsecurity, 2016. [Online] Available at: http://searchsecurity.techtarget.com/definition/authentication [Accessed 29 October 2018]. publib, 2014. [Online] Available at: https://publib.boulder.ibm.com/tividd/td/ITIM/SC32-170800/en_US/HTML/im460_plan76.htm [Accessed 07 October 2018]. publib, 2014. [Online] Available at: http://www.unixspace.com/context/databases.html [Accessed 07 October 2018]. searchsecurity, 2016. [Online] Available at: http://searchsecurity.techtarget.com/definition/authentication [Accessed 29 October 2018]. softwaretestingclub, 2011. [Online] Available at: http://www.softwaretestingclub.com/profiles/blogs/expalaining-verification-andvalidation [Accessed 27 October 2018]. studytonight, 2015. [Online] Available at: http://www.studytonight.com/dbms/database-model [Accessed 01 October 2018]. tldp, 2011. [Online] Available at: http://www.tldp.org/HOWTO/Security-HOWTO/password-security.html [Accessed 29 October 2018]. publib, 2014. [Online] Available at: https://publib.boulder.ibm.com/tividd/td/ITIM/SC32-170800/en_US/HTML/im460_plan76.htm [Accessed 07 October 2018]. publib, 2014. [Online] Available at: http://www.unixspace.com/context/databases.html [Accessed 07 October 2018]. searchsecurity, 2016. [Online] Available at: http://searchsecurity.techtarget.com/definition/authentication [Accessed 29 October 2018]. M. R. M Aashiq Yohan - JH55564 DAD 69 softwaretestingclub, 2011. [Online] Available at: http://www.softwaretestingclub.com/profiles/blogs/expalaining-verification-andvalidation [Accessed 27 October 2018]. studytonight, 2015. [Online] Available at: http://www.studytonight.com/dbms/database-model [Accessed 01 October 2018]. tldp, 2011. [Online] Available at: http://www.tldp.org/HOWTO/Security-HOWTO/password-security.html [Accessed 29 October 2018]. M. R. M Aashiq Yohan - JH55564 DAD 70 Picture reference econaws, 2015. [Online] Available at: https://s3.amazonaws.com/www.owlgen.com/wpcontent/uploads/2017/01/25172955/bottom-up-approach..jpg [Accessed 18 October 2018]. media.org, 2015. [Online] Available at: https://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Network_Model.svg/1200pxNetwork_Model.svg.png [Accessed 07 October 2018]. zonaws, 2015. [Online] Available at: https://s3.amazonaws.com/www.owlgen.com/wpcontent/uploads/2017/01/25173657/Top-Down-Approach.jpg [Accessed 16 October 2018]. cdn, 2015. [Online] Available at: http://cdn.ttgtmedia.com/searchDatabase/images/02fig07.gif [Accessed 08 October 2018]. econaws, 2015. [Online] Available at: https://s3.amazonaws.com/www.owlgen.com/wpcontent/uploads/2017/01/25172955/bottom-up-approach..jpg [Accessed 18 October 2018]. media.org, 2015. [Online] Available at: https://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Network_Model.svg/1200pxNetwork_Model.svg.png [Accessed 07 October 2018]. cdn, 2014. [Online] Available at: http://cdn.ttgtmedia.com/searchDatabase/images/02fig07.gif [Accessed 07 October 2018]. cdn, 2015. [Online] Available at: http://cdn.ttgtmedia.com/searchDatabase/images/02fig07.gif [Accessed 08 October 2018]. econaws, 2015. [Online] Available at: https://s3.amazonaws.com/www.owlgen.com/wp- M. R. M Aashiq Yohan - JH55564 DAD 71 content/uploads/2017/01/25172955/bottom-up-approach..jpg [Accessed 18 October 2018]. media.org, 2015. [Online] Available at: https://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Network_Model.svg/1200pxNetwork_Model.svg.png [Accessed 07 October 2018]. zonaws, 2015. [Online] Available at: https://s3.amazonaws.com/www.owlgen.com/wpcontent/uploads/2017/01/25173657/Top-Down-Approach.jpg [Accessed 16 October 2018]. cdn, 2015. [Online] Available at: http://cdn.ttgtmedia.com/searchDatabase/images/02fig07.gif [Accessed 08 October 2018]. zonaws, 2015. [Online] Available at: https://s3.amazonaws.com/www.owlgen.com/wpcontent/uploads/2017/01/25173657/Top-Down-Approach.jpg [Accessed 16 October 2018]. M. R. M Aashiq Yohan - JH55564 DAD 72 Gantt chart Figure 57 M. R. M Aashiq Yohan - JH55564 DAD 73