In Feburary 2016 20,
Open up the database program of your choice. This could be Microsoft Access, SQL Server, or Oracle. Create a few sample fields, such as First Name, Last Name, Address, City, State, and Zip. Then add a few sample records to test on.
Write your first query by typing out 'SELECT
FROM table_name' where table_name is the name of the table you created. This example returns every value from every field in the table within your database (the
indicates all). You can also say 'SELECT field_name FROM table_name' to select only the field_name field from your table.
Add to your last statement with the WHERE clause. The WHERE clause specifies which fields you want to return based on a certain value. 'SELECT * FROM table_name WHERE last_name = 'Morgan' ' will search for 'Morgan' in the last_name field and returns all records from the table in which the person's last name is Morgan. Note that if you are searching for a string (letters or words), you will need single quotes around the name. If you are searching for a number, you don't need the quotes.
Add to your last statement once again by using the ORDER BY clause. 'SELECT
FROM table_name ORDER BY last_name' will order your recordset by the person's last name in alphabetical order. You can also do 'SELECT
FROM table_name ORDER BY age' and it will order by the person's age (add DESC after the field name you wish to order by to list the names in descending order).
Create a new query by typing the INSERT INTO statement. The INSERT INTO statement inserts a new row into the table that you specify. 'INSERT INTO table_name VALUES ('Courtney','Morgan',14)' will add the first name of Courtney, the last name of Morgan, and the age of 14 into your table. Likewise, if you want to delete someone from your table, you will use the DELETE statement. 'DELETE FROM table_name WHERE last_name = 'Morgan' AND first_name = 'Courtney' ' will delete Courtney Morgan from your table.
Create another new query. Use the UPDATE statement. This will update a record instead of adding or deleting one. 'UPDATE table_name SET address = '555 Hollywood Blvd', city = 'Los Angeles' WHERE last_name = 'Morgan' AND first_name = 'Courtney' ' will update Courtney Morgan's address to 555 Hollywood Blvd and her city to Los Angeles.
In Feburary 2016 20,
Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts
Saturday, 20 February 2016
Friday, 19 February 2016
How to Use the SUM Function in MySQLIn Feburary 2016 19,
In Feburary 2016 19,
Use the SUM aggregate function. SUM will add all of the selected columns together.
Notice how, in this example, you'll sum all of the negative balances to calculate the total amount owed to you by your customers. The result returns in a column called SUM(balance). Example:
SELECT SUM(balance) FROM customers WHERE balance
Use the AVG Function in MySQL
Use the AVG aggregate function. This aggregate is similar to SUM. However, instead of adding the columns, it adds them and then divides by the total number of columns, giving you an average of the column values.
Use AVG in much the same way SUM is used. Here, the example calculates the average amount of money owed by customers. Results return in a column called AVG(balance). Example:
SELECT AVG(balance) FROM customers WHERE balance
Use the COUNT Function in MySQL
Use the COUNT aggregate function. This function is slightly different than SUM or AVG. It returns the number of rows returned, which can be useful in a number of situations--for example, to see the number of customers who owe money.
See how this example counts the customers who owe money and returns the result in a column called COUNT(
). Example:
SELECT COUNT(
) FROM customers WHERE balance
Use the DISTINCT COUNT Function in MySQL
Use the DISTINCT COUNT aggregate function. The function can be used to return the number of distinct rows, meaning those rows with differing values. Theoretically, you might have a lot of customers with the same phone number. To get the number of households your customers live in, you can use this type of query.
Use the following example to return the number of customers with distinct phone numbers. Customers with the same phone number will not be counted. The results are returned in a column called COUNT(DISTINCT ph_number). Example:
SELECT COUNT(DISTINCT ph_number) FROM customers;
In Feburary 2016 19,
Use the SUM aggregate function. SUM will add all of the selected columns together.
Notice how, in this example, you'll sum all of the negative balances to calculate the total amount owed to you by your customers. The result returns in a column called SUM(balance). Example:
SELECT SUM(balance) FROM customers WHERE balance
Use the AVG Function in MySQL
Use the AVG aggregate function. This aggregate is similar to SUM. However, instead of adding the columns, it adds them and then divides by the total number of columns, giving you an average of the column values.
Use AVG in much the same way SUM is used. Here, the example calculates the average amount of money owed by customers. Results return in a column called AVG(balance). Example:
SELECT AVG(balance) FROM customers WHERE balance
Use the COUNT Function in MySQL
Use the COUNT aggregate function. This function is slightly different than SUM or AVG. It returns the number of rows returned, which can be useful in a number of situations--for example, to see the number of customers who owe money.
See how this example counts the customers who owe money and returns the result in a column called COUNT(
). Example:
SELECT COUNT(
) FROM customers WHERE balance
Use the DISTINCT COUNT Function in MySQL
Use the DISTINCT COUNT aggregate function. The function can be used to return the number of distinct rows, meaning those rows with differing values. Theoretically, you might have a lot of customers with the same phone number. To get the number of households your customers live in, you can use this type of query.
Use the following example to return the number of customers with distinct phone numbers. Customers with the same phone number will not be counted. The results are returned in a column called COUNT(DISTINCT ph_number). Example:
SELECT COUNT(DISTINCT ph_number) FROM customers;
In Feburary 2016 19,
Monday, 15 February 2016
How to Test SSL ConnectionsIn Feburary 2016 15,
In Feburary 2016 15,
Navigate to the Secure Server SSL Connection Test website (see Resources).
Allow the website to load in your browser. As the website is testing whether your computer is configured for SSL, the webpage may take a few moments to load. If the webpage returns a result of 'Successful' at the top of the page, your computer is configured for SSL.
Click 'I Understand the Risks' after entering the test website into your browser's navigation bar, if you are using the Firefox browser. Click 'Add exception,' then 'Get Certificate' and finally 'Confirm Security Exception.' The test website will then load and your results will be displayed.
Data Consultants Website Test
Navigate to the Data Consultants webpage (see Resources).
Click 'Test ssl connection.' Allow the website to load in your browser. If the webpage returns a result of 'Your browser established SSL (Secure Sockets Layer) connection with this server' at the top of the page, your computer is configured for SSL.
Click 'I Understand the Risks' after entering the test website into your browser's navigation bar, if you are using the Firefox browser. Click 'Add exception,' then 'Get Certificate' and finally 'Confirm Security Exception.' The test website will then load and your results will be displayed.
Nettally Website Test
Navigate to the Nettally website (see Resources).
Allow the website to load in your browser. If the webpage returns a result of 'Successful' at the top of the page, your computer is configured for SSL.
Click 'I Understand the Risks' after entering the test website into your browser's navigation bar, if you are using the Firefox browser. Click 'Add exception,' then 'Get Certificate' and finally 'Confirm Security Exception.' The test website will then load and your results will be displayed.
In Feburary 2016 15,
Navigate to the Secure Server SSL Connection Test website (see Resources).
Allow the website to load in your browser. As the website is testing whether your computer is configured for SSL, the webpage may take a few moments to load. If the webpage returns a result of 'Successful' at the top of the page, your computer is configured for SSL.
Click 'I Understand the Risks' after entering the test website into your browser's navigation bar, if you are using the Firefox browser. Click 'Add exception,' then 'Get Certificate' and finally 'Confirm Security Exception.' The test website will then load and your results will be displayed.
Data Consultants Website Test
Navigate to the Data Consultants webpage (see Resources).
Click 'Test ssl connection.' Allow the website to load in your browser. If the webpage returns a result of 'Your browser established SSL (Secure Sockets Layer) connection with this server' at the top of the page, your computer is configured for SSL.
Click 'I Understand the Risks' after entering the test website into your browser's navigation bar, if you are using the Firefox browser. Click 'Add exception,' then 'Get Certificate' and finally 'Confirm Security Exception.' The test website will then load and your results will be displayed.
Nettally Website Test
Navigate to the Nettally website (see Resources).
Allow the website to load in your browser. If the webpage returns a result of 'Successful' at the top of the page, your computer is configured for SSL.
Click 'I Understand the Risks' after entering the test website into your browser's navigation bar, if you are using the Firefox browser. Click 'Add exception,' then 'Get Certificate' and finally 'Confirm Security Exception.' The test website will then load and your results will be displayed.
In Feburary 2016 15,
Labels:
click,
configured,
moments,
result,
returns,
Risks,
successful,
top,
Understand,
webpage
Subscribe to:
Comments (Atom)