Answer:
Changing the customer number on a record in the Orders table to a number that does not match a customer number in the customer table would violate referential integrity.
If deletes do not cascade, deleting a customer that has orders would violate referential integrity.
If deletes cascade, customer can be deleted and all orders for that customer will automatically be deleted.
Answer:
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
int[] array = new int[10];
int index = 0;
while(index < array.size()){
int number = (rand() % 100) + 1;
for (int i = 0; i < 1; i++) {
array[index] = number;
cout<< "Position "<< index << "of the array = "<< number << endl;
++index;
}
}
}
Explanation:
The while loop in the source code loops over a set of code ten times, The for loop only loops once to add the generated random number between 1 and 100 to the array of size 10. At the end of the for loop, the index location and the item of the array is printed out on the screen. The random number is generated from the 'rand()' function of the C++ standard library.
Answer:
The Statement for selecting values from the table in SQL is given below,
SELECT vendor_name, vendor_contact_last_name, vendor_contact_first_name FROM Vendors;
Explanation:
SQL stands for Structured query language which is used to insert, update, delete and modify the value in a table.
There are five types of SQL-
1. Data definition language
2. Data manipulation language
3. Data control language
4. Transaction Control Language
5. Data Query Language
The SELECT statement comes under DDL which is used to select and display values from a table.
We can use select statement in two ways-
1. SELECT column_name1, column_name2 ........column_nameN FROM Table_name;
2. SELECT * FROM tablename; ( This is used to select all values from the table name)
We can also give conditions using WHERE clause while selecting values.