Wednesday, September 26, 2012

How to Set a Table Setting a Dinner Table Properly

Setting a table and table manners go side by side. Proper table setting means locating dishware and tableware in a precise way. If proper instructions are followed, then how to set a table becomes lot easier.

Usually on the name of setting a table, we just put all the stuff such as eating utensils on the table and relax as every thing is done with it. However, table setting etiquettes demands attention. There is a way to proper set a table. Here are some guidelines to learn how to set a table properly.

Do not worry for an upcoming dinner party, just read on the following table manners for proper table setting placement.

Setting a table properly is very important as it makes your food more special. These table manners rules should be followed for a long lasting impression in a dinner party. A thing to remember while setting a table is to place dinner plate when guests sit down.





iAutoblog the premier autoblogger software
READ MORE - How to Set a Table Setting a Dinner Table Properly

Tuesday, September 25, 2012

How To Set A Festive Christmas Table

Whether you are a novice or expert, setting a festive Christmas table can be easy and fun. When I look at my Christmas table all set and decorated, it truly brings in the holiday spirit and warms the cockles of my heart. The thoughts of family and friends permeate throughout my mind and remind me of how truly blessed I am. What a wonderful life I have and the many blessings that have come my way.

As with any type of decorating, you want to have each room compliment each other. For instance, if your Christmas decorating is modern, you want to keep your Christmas Table Setting modern. As you walk into your Dining Room the character of the table should mimic your decorating taste. There are so many different products out there today that it can be difficult to choose but I know that you will find what you need to accomplish this.

Before you being, let's take a minute to go over the basics of table setting.

Keep in mind the following when planning to set your Christmas Table

How many guests are you having, what type of table - round, square or oblong, formal or casual? What type of mood are you looking to create? What do you need to accomplish your "look"?

Table Padding helps with the setting of your festive Christmas Table. Not only does the table padding protect your table finish from liquid spills, hot spots, scratches, dents and nicks it helps to absorb sound and gives the tablecloth a gentle flowing drape and prevents the tablecloth from sliding or pulling.

Table padding is made of felt and vinyl and the soft backing is safer for many modern finishes. Table padding comes in many sizes or can be cut to the size of your table or cut longer to include the drop or overhang. And there is always the option of having a custom made pad for your table.

Tablecloths come in standard sizes for square, round, oblong (rectangle) and oval. Need help figuring out what size and shape of tablecloth you need?

Do you know the difference between and oblong and oval tablecloth? Many time people confuse oblong with oval. An oblong tablecloth is designed to fit a rectangle table with square corners and an oval tablecloth fits an egg-shaped table.

Do you know how to figure out your tablecloth size?Measure the width and length of your table. Add the overhang or drop, which is how long the tablecloth will hang over the side, typically the desired overhang is 10-12 to lap level on dining tables and 15 inches for banquet tables.

When you have these measurements, add the overhang times 2 to each measurement of your table. You don't want the tablecloth to be too long. Your guests should be able to be able to sit and not have the tablecloth touch their legs, you don't want anyone pulling that tablecloth!!

Example: If your table size is 30x72 inches and the desired drop is 10 inches you would figure it this way:10 inch (drop size) X 2 would be 20 inchesAdd the 30" (from your table measurement) to the 20" (doubled desired drop) = 50 inchesAdd the 72" (from your table measurement) to the 20" (doubled desired drop) = 92 inches

The perfect cloth size for your table would be 50 X 92 inches. Since tablecloths come in standard sizes you would then select the size closest to those figures.

I have a rectangle table and start with a biege tablecloth, then I use a square green colored tablecloth laid down with the points showing at the mid point of the table, add a table runner and use a small corresponding table square. Layering Looks stunning!!!

I am a big fan of Table Runners, they just add a little something extra to your table setting and can be used to compliment your linens, china and decor. Table runners can also be used to hide a leaf in the table. Table runners are sometimes called "scarves" and are pieces of material that run lengthwise or across your table. Table runners can run within the dimensions of a table or extend into the overhang.

You can really go all out and decorate your chairs. There are many varieties of chair coverings or slipcovers that give your table an even more elegant look.

I use taffeta scarves or runners and tie them around the back of the chair with a big bow and place a flower in the middle of the bow. This creates a stunning and polished look at your festive Christmas table.

There are so many things that you can do with a napkin.

Napkins are a piece of material (made of cloth or paper) used to clean the lips or fingers and for protection of clothing. Napkins can be made of a variety of fabrics including cotton, linen, silk, and cotton/polyester blends. Cotton, Linen, and Silk napkins are typically used for more formal settings while cotton/polyester blends are used for casual everyday dining.

Turning a plain piece of cloth into an exotic swan for instance, brings back my many days in the catering business. Napkin folding can turn your table into an elegant work of art and it is an easy and fun task. Not into napkin folding, then napkin rings are the best thing. There are napkin rings for anyone budget and taste.

The Charger is making a big come back on tables. The charger makes a table look more elegant, whether serving dinner to your family or entertaining the guests.

Chargers are simply under plates that are used at each place setting of a formal table. The charger will be larger than the actual dinner and salad plates used to hold the food. The dinner plate is never placed on the charger. When you are shopping for chargers, place the salad plate or soup bowl, not the dinner plate, on the charger to see how it sizes and coordinates.

The charger should compliment the choices of china, silverware, and dcor of the table setting. A charger may be used with or without placemats, depending on your table setting.

The use of the right charger can add a touch of elegance to the table. By coordinating the design of the table setting, the color choices, and the pattern used for the china, the charger will beautify other pieces and create a sense of an elegant and festive table setting.

I could go on forever about the different types, shapes, sizes and colors of Christmas Dishes, there are so many that are available to you. What it really boils down to is your taste and what you like. For me, I like clean lines and borders and have a set of Mikasa China that I use for all holiday's, ivory dishes with a gold inlaid border. Plain and simple and I use chargers, tablecloths, napkins and decorations to bring in the color of the holiday.

Now on the other hand, many people have a set of Christmas Dishes and Tableware such as Spode, Lennox, Mikasa and the list goes on from the most expensive to the least expensive. It's up to you, your budget and your taste.

Most sets of china come with some basic serving dishes and if you are like me over the years I have accumulated additional serving pieces for my china. Then there are the holiday serving pieces that we save over the years.

But for ease of serving and cleaning, I like to use Stoneware/CorningWare serving dishes, that can easily go from the oven to your table. Stoneware is attractive, microwave proof and even oven proof. Right from your oven to your table, eliminating extra dishes, pots and pans. Another reason you need table padding, to save your table from the heat of serving dishes.

Just as versatile as stoneware is Corning ware, both help eliminate extra chores on a busy Christmas Day and add beauty to your Christmas Table.

Most of us know how to set a table, but for those that need a little refresher here is an overview...

* Forks should go on the left and spoons and knives to the right of the plate* An easy way to remember the correct order to place utensils is that they go in the order in which you use them; so the salad fork goes on the outside left while the larger fork used to eat the main course goes on the inside left. Turn the blade of all knifes so they face toward the plate, why well in midevil times the blade pointing out meant harm to the person next to you.* If you are using chargers, place the salad plate and/or soup bowl on the charger.* Place the side plate or bread and butter plate to the left of your place setting;* Place the wineglass at the tip of the main-course knife. The water glass and any other glasses should be arranged in the order they will be used with the first one on the outside.* The napkins can go under the knife and spoon or on the side plate. If you choose to use napkin holders or fancy folds, the napkin can go on top of the charger plate set up or even in the water glass for a more decorative and elegant place setting.

Truth be told...I leave the place cards to the kids, who have a great time trying figuring out who sits next to who. It's a great touch to create and decorate place cards.

Place the cards either on the charger plate setup or better yet in attractive place card holders which are placed on the charger plate setup or directly on top of the charger plate setup.

Using place or name cards adds a finishing touch on your festive Christmas Table Setting.

What do you say about Glassware? There are so many styles and shapes that just can boggle the mind.

If you are using a Christmas pattern such as Spode, you most likely have the coordinating glassware. Most importantly, set a water glass, wine glass if you serve wine or alcohol and for the more adventurous, a stylish shot glass for the tradition after dinner sambuca with coffee beans.

Finally, for an extra special touch, you could leave a small gift at each place setting. If you shop around in dollar discount stores you can find all kinds of small gift items. Wrap them and use ribbon to give them a holiday look. You could even place the name cards in a frame for your guests to bring home. Opening the gifts will make a great conversation starter when everyone sits down at the table.

Decorating your table with a festive Centerpiece will give your table a festive Christmas feeling. Candlesticks are another great way to decorate your table and add a flair of elegance. You can also use candles and music to create the perfect festive Christmas setting.

The final and finishing touches create a festive Christmas Table Setting!

Ann Cohen is a mom, wife, friend and caterer who love babies, "green", decorating and holiday's. Being able to entertain and decorate on a budget is important today and loves finding that "great deal." To get some more tips on how to's, green and saving money check out How To Set A Festive Christmas Table and browse her selection of how to's.





iAutoblog the premier autoblogger software
READ MORE - How To Set A Festive Christmas Table

Monday, September 24, 2012

How To Set The Perfect Thanksgiving Table

The holidays are fast approaching with Thanksgiving only a few weeks away and we are starting to think about preparing our family feasts. Whether you are serving a small family of 2 or extended family of 20, you can have the picture perfectThanksgiving table. Your Thanksgiving table can be casual or elaborate as you want.

Setting your Thanksgiving table starts with the perfect picture in your mind. The colors of fall are beautiful and intertwined. Choose your colors for your table linens. Personally, I start with a solid color table cloth and compliment the table cloth with a harvest style runner, very eye catching.

Keep in mind the colors of your dishes, compliment the dishes with your corresponding table linens. You can choose a printed table cloth and solid runner or solid table cloth and solid runner, or a solid table cloth with a design embedded, remember that picture in your mind.

Table Padding helps with the setting of your perfect Thanksgiving Table. Not only does the table padding protect your table finish from liquid spills, hot spots, scratches, dents and nicks it helps to absorb sound and gives the tablecloth a gentle flowing drape and prevents the tablecloth from sliding or pulling.

Table padding is made of felt and vinyl and the soft backing is safer for many modern finishes. Table padding comes in many sizes or can be cut to the size of your table or cut longer to include the drop or overhang.

Need help figuring out what size and shape of tablecloth you need? Tablecloths come in square, round, oblong (rectangle), and oval.

Do you know the difference between and oblong and oval tablecloth? Many time people confuse oblong with oval. An oblong tablecloth is designed to fit a rectangle table with square corners and an oval tablecloth fits an egg-shaped table.

Do you know how to figure out your tablecloth size?Measure the width and length of your table. Add the overhang or drop, which is how long the tablecloth will hang over the side, typically the desired overhang is 10-12 to lap level on dining tables and 15 inches for banquet tables.

Once you have these measurements, add the overhang times 2 to each measurement of your table. You don't want the tablecloth to be too long. Your guests should be able to be able to sit and not have the tablecloth touch their legs, you don't want anyone pulling that tablecloth!!

Example: If your table size is 30x72 inches and the desired drop is 12 inches you would figure it this way:12 inch (drop size) X 2 would be 24 inchesAdd the 30" (from your table measurement) to the 24" (doubled desired drop) = 54 inchesAdd the 72" (from your table measurement) to the 24" (doubled desired drop) = 96 inches

The perfect cloth size for your table would be 54 X 96 inches. Tablecloths typically comes in standard sizes you would then select the size closest to those figures.

I happen to be a big fan of Table Runners. Table runners are sometimes called "scarves" and are pieces of material that run lengthwise or across your table. Table runners can run within the dimensions of a table or extend into the overhang.

Table runners have been used for centuries to decorate tables, sideboards and buffets when not in use. Heirlooms were displayed on runners, such as candlesticks, centerpieces and bowls. Table runners have come along way, today they are used for decorations, and are a big trend in table setting.

I think Table Runners add character to a table setting, especially at Thanksgiving and the holidays. They can be used to complement your table linens, used as decorations, to hide a leaf or just let your imagination run wild.

The Charger is making a big come back on tables. The charger makes a table look more elegant, whether serving dinner to your family or entertaining the guests.

Chargers are simply under plates that are used at each place setting of a formal table. The charger will be larger than the actual dinner and salad plates used to hold the food. The dinner plate is never placed on the charger. When you are shopping for chargers, place the salad plate or soup bowl, not the dinner plate, on the charger to see how it sizes and coordinates.

When dinner is served in courses. The appetizer, soup, and salad plates are placed on the charger, creating and elegant look and the charger also helps to keep the area around the diner clean before the entree is served.

The charger should compliment the choices of china, silverware, and dcor of the table setting. A charger may be used with or without placemats, depending on your table setting.

The use of the right charger can add a touch of elegance to the table. By coordinating the design of the table setting, the color choices, and the pattern used for the china, the charger will beautify other pieces and create a sense of an elegant table setting.

A napkin is a napkin or is it?

There are so many things that you can do with a napkin.

Napkins are a piece of material (made of cloth or paper) used to clean the lips or fingers and for protection of clothing. Napkins can be made of a variety of fabrics including cotton, linen, silk, and cotton/polyester blends. Cotton, Linen, and Silk napkins are typically used for more formal settings while cotton/polyester blends are used for casual everyday dining.

Turning a plain piece of cloth into an exotic swan for instance, brings back my many days in the catering business. Napkin folding can turn your table into an elegant work of art and it is an easy and fun task. Not into napkin folding, then napkin rings are the best thing. There are napkin rings for anyone budget and taste.

For ease of serving and cleaning, I like to use Stoneware/CorningWare serving dishes, that can easily go from the oven to your table. Stoneware is attractive, microwave proof and even oven proof. Right from your oven to your table, eliminating extra dishes, pots and pans. Another reason you need table padding, to save your table from the heat of serving dishes.

Just as versatile as stoneware is Corning ware, both help eliminate extra chores on Thanksgiving Day and add beauty to your Thanksgiving Table.

Most of us know how to set a table, but for those that need a little refresher here is an overview...For those who never went to finishing school or who don't set a formal table on a regular basis, let's start with a quick overview on how to set the table:

* Forks should go on the left and spoons and knives to the right of the plate.* An easy way to remember the correct order to place utensils is that they go in the order in which you use them; so the salad fork goes on the outside left while the larger fork used to eat the main course goes on the inside left. Turn the blade of all knifes so they face toward the plate, why well in midevil times the blade pointing out meant harm to the person next to you.* If you are using chargers, place the salad plate and/or soup bowl on the charger.* Place the side plate or bread and butter plate to the left of your place setting;* Place the wineglass at the tip of the main-course knife. The water glass and any other glasses should be arranged in the order they will be used with the first one on the outside.* The napkins can go under the knife and spoon or on the side plate. If you choose to use napkin holders or fancy folds, the napkin can go on top of the charger plate set up or even in the water glass for a more decorative and elegant place setting.

Truth be told...I leave this to the kids, who have a great time trying figuring out who sits next to who. It's a great touch to create and decorate place cards.

Place the cards either on the charger plate setup or better yet in attractive place card holders which are placed on the charger plate setup or directly on top of the charger plate setup.

Using place or name cards adds a finishing touch on your Thanksgiving Table Setting.

What do you say about Glassware? There are so many styles and shapes that just can boggle the mind. Most importantly, set a water glass, wine glass if you serve wine or alcohol and for the more adventurous, a stylish shot glass for the tradition after dinner sambuca with coffee beans.

You could leave a small gift at each place setting. You could even place the name cards in a frame for your guests to bring home.

Decorating your table with a Harvest Centerpiece or Cornucopia will give your table a Thanksgiving feeling. Candlesticks are another great way to decorate your table and add a flair of elegance.

The final and finishing touches create a perfect Thanksgiving Table Setting!

Learn more about setting your Thanksgiving Table at Set The Perfect Thanksgiving Table and make your Thanksgiving picture perfect.

Ann Cohen is a former caterer who loves to entertain and decorate on a budget.





iAutoblog the premier autoblogger software
READ MORE - How To Set The Perfect Thanksgiving Table

Sunday, September 23, 2012

Word Tutorial: How to Create Great Tables in Word With Borders And Shading?

A newsletter created with Word tables and the Borders and Shading option

A table with a 3D border

A table with two color-shaded cells and a 3D border

Spruce up the tables you create in Word with borders and shades. These give great looks to the table and attract readers to the data in it. Through the Borders and Shading dialog create borders and shades for the table. Do you know you can even create newsletter templates, using tables and the borders and shading option? Its possible. Checkout the section Step-by-Step Procedure to Create a Newsletter Template using Tables and the Borders and Shading Option in Word.

Borders for a Word Table: Use a variety of styles for the border. Some of these are a dashed line, double lines with curves and 3D bars. Whats more, choose one of the two varieties of 3D style: a raised or inset bar.

Want to create borders only on the left and right side of the table? Thats possible too! Further, you can select a color for the borders from the color palette, and choose a line width different from the default size.

Shading for a Word Table: Make the table even more attractive with the shading effect in Word. Note you can either shade the entire table or just a paragraph or a cell.

Shades, like borders, give a new dimension to tables. Shades have creative uses. For example, for the mast of a newsletter create a 2 X 1 table. Remove its borders. Shade the table. In the first row, type the title of the newsletter. In the second, type info like the Volume and Issue number and Date.

Step-by-Step Procedure to Create a Table with Borders in Word

1. Start Word.

.......................................................................................................................................................

2. Click the Table Icon. Move the cursor over the drop-down grid to highlight the cells to create a table with the required number of rows and columns. Click the last highlighted cell.

Click the Table icon, highlight the first four cells and click

For example, if you need a table with just one row and one column, highlight the first cell of the grid and click. To create a table with two rows and two columns, move the cursor over the first two cells of the first and second rows of the grid. Click the fourth cell.

For this tutorial, lets create a 2 X 2 table as above.

A 2 X 2 table created .......................................................................................................................................................

3. Create a border for the table: Right-click inside the table. From the menu, click Borders and Shading. The Borders and Shading dialog appears.

Right-click inside the table and select Borders and Shading

The Borders and Shading dialog .......................................................................................................................................................

4. Say you want to create borders on all sides of the table with a 3D style: Click the All swatch in the Settings frame.

Click the All swatch to create borders on all sides of the table .......................................................................................................................................................

5. From the Style pull-down menu, select a 3D style. For this tutorial, I have chosen the raised-bar 3D style.

Select a style from the Style pull-down menu

.......................................................................................................................................................

6. From the Color pull-down menu, select a color if you want a color different from the default.

Select a color for the borders

.......................................................................................................................................................

7. From the Width pull-down menu, select a width or accept the default.

.......................................................................................................................................................

8. Click OK. Word creates a border on all sides of the table with the style, color and width you selected.

A 2 X 2 table with a green-color 3D border

.......................................................................................................................................................

9. Use a different style for the border: Lets change the 3D border to a style to one with two curved lines. Click the Style menu down-arrow. Select the style. Click OK. Word applies the style to the borders of the table.

....................................................................................................................................................... .......................................................................................................................................................

Step-by-Step Procedure to Shade a Table Cell in Word

1. Lets shade the two cells of the first row of the 3D table:

Highlight the two cells of the first row of the table with the mouse.

.......................................................................................................................................................

2. Right-click inside the table. From the menu, select Borders and Shading. The Borders and Shading dialog appears.

The Borders and Shading dialog

.......................................................................................................................................................

3. Click the Shading tab.

.......................................................................................................................................................

4. Click a color swatch in the palette in the Fill frame.

Select a color for shading from the color palette

.......................................................................................................................................................

5. In the Apply to pull-down menu on the right, select Cell.

.......................................................................................................................................................

6. Click OK. Word shades the cells.

The two cells of the first row of the table shaded ....................................................................................................................................................... .......................................................................................................................................................

Step-by-Step Procedure to Create a Newsletter Template using Tables and the Borders and Shading Option in Word

Lets use three tables to create a newsletter template. The first table will be a 2 X 1 table. It will be used as the mast for the newsletter. The second table (optional) is for placing graphics. The third table is for the newsletter content. This table will have borders on all sides, but not have the grid.

1. Create the first table, which will be used as the mast: Repeat Step 2 in Step-by-Step Procedure to Create a Table with Borders in Word above.

.......................................................................................................................................................

2. Remove the borders of the table: Right-click inside the table and from the menu, select Borders and Shading. The Borders and Shading dialog appears.

The Borders and Shading dialog

.......................................................................................................................................................

3. Click the three buttons in vertical orientation in the Preview pane to remove the left, middle, and right borders. Click the two buttons in horizontal orientation to remove the top and bottom borders.

Click the buttons in the Preview pane to remove the borders

TIP: If you want to display any border again, click the relevant button in the Preview pane.

.......................................................................................................................................................

4. Shade the table: Click the Shading tab.

.......................................................................................................................................................

5. Select a color from the palette in the Fill frame.

.......................................................................................................................................................

6. In the Apply to menu on the right, select Table (if its not already the default).

.......................................................................................................................................................

7. Click OK. Word shades the table.

Table shaded with green color

.......................................................................................................................................................

8. Type the content for the mast of the newsletter.

Content typed for the mast in the two cells of the table

.......................................................................................................................................................

9. Create the second table (optional): Repeat Step 2 in Step-by-Step Procedure to Create a Table with Borders in Word above and create a 1 X 2 table.

.......................................................................................................................................................

10. Remove the borders of the table as above and place the graphics. To insert a graphic, click Insert > Picture > From File.

Graphic inserted in column 1 and 2 of the table .......................................................................................................................................................

11. Create the third table: Repeat Step 2 in Step-by-Step Procedure to Create a Table with Borders in Word above and create a 1 X 1 table.

.......................................................................................................................................................

12. Apply a new border style to the table: Right-click inside the table and from the menu, select Borders and Shading. The Borders and Shading dialog appears.

.......................................................................................................................................................

13. Select a style from the Style field. For this tutorial, I have used the line pair with curves.

Select a style for the borders

.......................................................................................................................................................

14. Apply a new color to the borders: From the Color field select a color.

.......................................................................................................................................................

15. Click OK. Word creates a new border with the chosen color.

The borders of the table for the content part of the newsletter

.......................................................................................................................................................

16. Type the newsletter content.

A completed newsletter created using tables in Word





iAutoblog the premier autoblogger software
READ MORE - Word Tutorial: How to Create Great Tables in Word With Borders And Shading?

Saturday, September 22, 2012

Altering And Dropping Tables in Mysql

Implementing Database in MySQL - Part 7

Introduction This is part 7 of my series, Implementing Database in MySQL. I assume you have read all the different parts of the series (or equivalent tutorials from elsewhere) up to this point. In this part of the series, we see how to alter and drop tables in the MySQL database.

We are still dealing with data definition. Remember data definition deals with creating of tables, altering tables, dropping tables, creating of indexes and giving different users, privileges to different tables. We have seen how to create tables and give them indexes. In this part of the series we shall see how to alter and drop tables. We shall see how to create user accounts (user name and password) and grant them certain permissions in the next part of the series.

Note: If you cannot see the code or if you think anything is missing (broken link, image absent), just contact me at That is, contact me for the slightest problem you have about what you are reading.

Altering a Table To create a table means to create the table structure (automatically saving the table in the database file). To alter a table, means to alter the table structure. It is not anybody who has the right to alter a table. You will be able to do that now because you are the database administrator (with userID that is root). A database administrator has the rights to do anything in the database.

We shall start by looking at some examples, which alter tables. After that I will give you the complete syntax and explain how to read the complete syntax.

Example We continue with the wholesale example.

- Type the following commands in the command prompt to start the server, connect to it and start the database; enter the password, sql:

cd c: "C:Program FilesMySQLMySQL Server 5.1inmysql" -u root -p USE wholesale;

- Let us add a Total column to the OrderDetails table. Execute the following SQL statement:

ALTER TABLE Orders ADD Total DECIMAL(19,2);

A Total column is a computed value column. You normally do not have to include it; I have done so just for illustration.

Dropping a Table In simple terms the SQL statement syntax to drop a table is:

DROP TABLE table-name;

You will now create a table in the database and then drop it. Dropping a table means erasing the table from the database disk.

- Type and execute the following:

CREATE TABLE Purchase ( purchase_num INTEGER NOT NULL PRIMARY KEY, date_purchased DATE, name CHAR(80) );

You should now have a new table called Purchase.

- Now you will delete the table you have just created. Type the following and execute:

DROP TABLE Purchase;

The new table purchase should have been erased.

Let us now drop the connection, stop the database and stop the server. Type the following and press Enter:

QUIT

Complete Syntax to Alter a Table The complete syntax of the SQL Statement to alter a table is given below; glance through it and read the explanation below it:

2.1.7. ALTER TABLE Syntax

ALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ...

alter_specification: table_options | ADD [COLUMN] col_name column_definition [FIRST | AFTER col_name ] | ADD [COLUMN] (col_name column_definition,...) | ADD {INDEX|KEY} [index_name] [index_type] (index_col_name,...) [index_option] ... | ADD [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...) [index_option] ... | ADD [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY] [index_name] [index_type] (index_col_name,...) [index_option] ... | ADD FULLTEXT [INDEX|KEY] [index_name] (index_col_name,...) [index_option] ... | ADD SPATIAL [INDEX|KEY] [index_name] (index_col_name,...) [index_option] ... | ADD [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...) reference_definition | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT} | CHANGE [COLUMN] old_col_name new_col_name column_definition [FIRST|AFTER col_name] | MODIFY [COLUMN] col_name column_definition [FIRST | AFTER col_name] | DROP [COLUMN] col_name | DROP PRIMARY KEY | DROP {INDEX|KEY} index_name | DROP FOREIGN KEY fk_symbol | DISABLE KEYS | ENABLE KEYS | RENAME [TO] new_tbl_name | ORDER BY col_name [, col_name] ... | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name] | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name] | DISCARD TABLESPACE | IMPORT TABLESPACE | partition_options | ADD PARTITION (partition_definition) | DROP PARTITION partition_names | COALESCE PARTITION number | REORGANIZE PARTITION [partition_names INTO (partition_definitions)] | ANALYZE PARTITION {partition_names | ALL } | CHECK PARTITION {partition_names | ALL } | OPTIMIZE PARTITION {partition_names | ALL } | REBUILD PARTITION {partition_names | ALL } | REPAIR PARTITION {partition_names | ALL } | PARTITION BY partitioning_expression | REMOVE PARTITIONING

index_col_name: col_name [(length)] [ASC | DESC]

index_type: USING {BTREE | HASH}

index_option: KEY_BLOCK_SIZE [=] value | index_type | WITH PARSER parser_name

table_options: table_option [[,] table_option] ... (see CREATE TABLE options)

Explaining the Syntax I will just explain how I came about the following statement:

ALTER TABLE Orders ADD Total DECIMAL(19,2);

I used this statement to add a new column.

The complete syntax is in sections. The lower you go down the syntax the more details you find about a word or phrase above in the syntax. In the syntax, | means and/or at that position; anything in square brackets is optional.

The first line in the syntax is:

ALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ...

From this first line, I got

ALTER TABLE Orders

for my own statement and I then proceeded to the details of, alter_specification, in the syntax. From the first line of the details of, alter_specification, I got

ADD Total DECIMAL(19,2);

for my statement.

That is the kind of procedure you should follow to determine your own Altering SQL statements. You should apply the same reasoning to understand other syntaxes in MySQL, such as the CREATE TABLE syntax we saw in one of the previous parts of the series.

Time to take a break. Let us stop here and continue in the next part.

Chrys

To arrive at any of the parts of this division, type the corresponding title below in the search box of this page and click Search (use menu if available).

Implementing Database in MySQL - Part 1 Implementing Database in MySQL - Part 2 Implementing Database in MySQL - Part 3 Implementing Database in MySQL - Part 4 Implementing Database in MySQL - Part 5 Implementing Database in MySQL - Part 6 Implementing Database in MySQL - Part 7 Implementing Database in MySQL - Part 8 Implementing Database in MySQL - Part 9 Implementing Database in MySQL - Part 10 Implementing Database in MySQL - Part 11 Implementing Database in MySQL - Part 12 Implementing Database in MySQL - Part 13 Implementing Database in MySQL - Part 14 Implementing Database in MySQL - Part 15





iAutoblog the premier autoblogger software
READ MORE - Altering And Dropping Tables in Mysql

Friday, September 21, 2012

Temporary Table in Sybase Sql Anywhere

Handling Sybase Events with Triggers and Procedures Using SQL - Part 13 Division 5

Introduction This is part 13 of my series, Handling Sybase Events with Triggers and Stored Procedures Using SQL. This series is the fifth division of my larger series, Database. You must have read all the different parts of the big series (or equivalent tutorials from elsewhere) up to this point. In this part of the series, we look at temporary tables in Sybase SQL Anywhere 12.

Note: If you cannot see the code or if you think anything is missing (broken link, image absent), just contact me at That is, contact me for the slightest problem you have about what you are reading.

Local Temporary Table A temporary table is a table that is saved in a temporary file. A temporary file is a file that will be deleted soon. There are two types of temporary tables: local temporary tables and global temporary tables. In this series we shall deal only with local temporary tables.

A local temporary table is for a connection. It exists as long as the connection is on. If the temporary table is defined inside a compound statement, it will exist as long as the compound statement is operating. You can create a local temporary table for a connection or you can declare a local temporary table in a compound statement.

Local Temporary Table for a Connection You create a temporary table for a connection in the same way that you create a base table, but you precede the table name with the pound sign, #. A simplified syntax is:

CTREATE TABLE #table-name ( { column-definition [ column-constraint ... ] | table-constraint | pctfree }, ... )

Try the following:

CREATE TABLE #Women ( WomanID INTEGER DEFAULT AUTOINCREMENT, Name CHAR(40) INDEX, Address CHAR(60), City CHAR(30), State CHAR(30), Country CHAR(40), Phone CHAR(12),

PRIMARY KEY (WomanID ASC) );

Local Temporary Table for a Compound Statement To create a local temporary table in a compound statement use the syntax (simplified):

DECLARE LOCAL TEMPORARY TABLE table-name ( { column-definition [ column-constraint ... ] | table-constraint | pctfree }, ... )

Now this table will cease to exist when the program is not operating in the compound statement.

So to have a local temporary table in a procedure, you should use the above DECLARE statement. However, if you want a local temporary table in a procedure that would be for the connection (last after the procedure completes), use the following syntax (simplified):

CREATE LOCAL TEMPORARY TABLE table-name ( { column-definition [ column-constraint ... ] | table-constraint | pctfree }, ... )

Note: You cannot use the REFERENCES column-constraint or the FOREIGN KEY table-constraint on a local temporary table.

A temporary table is used like other tables, but you do not want the table saved. We shall see a practical use of this later.

Well, let us end here for this tutorial. We continue in the next part of the series.

Chrys

To arrive at any of the parts of this division, type the corresponding title below in the search box of this page and click Search (use menu if available).

Handling Sybase Events with Triggers and Procedures Using SQL - Part 1 Handling Sybase Events with Triggers and Procedures Using SQL - Part 2 Handling Sybase Events with Triggers and Procedures Using SQL - Part 3 Handling Sybase Events with Triggers and Procedures Using SQL - Part 4 Handling Sybase Events with Triggers and Procedures Using SQL - Part 5 Handling Sybase Events with Triggers and Procedures Using SQL - Part 6 Handling Sybase Events with Triggers and Procedures Using SQL - Part 7 Handling Sybase Events with Triggers and Procedures Using SQL - Part 8 Handling Sybase Events with Triggers and Procedures Using SQL - Part 9 Handling Sybase Events with Triggers and Procedures Using SQL - Part 10 Handling Sybase Events with Triggers and Procedures Using SQL - Part 11 Handling Sybase Events with Triggers and Procedures Using SQL - Part 12 Handling Sybase Events with Triggers and Procedures Using SQL - Part 13 Handling Sybase Events with Triggers and Procedures Using SQL - Part 14 Handling Sybase Events with Triggers and Procedures Using SQL - Part 15 Handling Sybase Events with Triggers and Procedures Using SQL - Part 16





iAutoblog the premier autoblogger software
READ MORE - Temporary Table in Sybase Sql Anywhere

Thursday, September 20, 2012

Altering And Dropping Tables in Sybase

Implementing Database in Sybase - Part 7 Division 4

Introduction This is part 7 of my series, Implementing Database in Sybase. This series is part of the fourth division of my larger series, Database. I assume you have read all the different parts of the big series (or equivalent tutorials from elsewhere) up to this point. In this part of the series, we see how to alter and drop tables in the Sybase SQL Anywhere 12.

We are still dealing with data definition. Remember data definition deals with creating of tables, altering tables, dropping tables, creating of indexes and giving different users, privileges to different tables. We have seen how to create tables and give them indexes. In this part of the series we shall see how to alter and drop tables. We shall see how to create user accounts (user name and password) and grant them certain permissions in the next part of the series.

Note: If you cannot see the code or if you think anything is missing (broken link, image absent), just contact me at That is, contact me for the slightest problem you have about what you are reading.

Altering a Table To create a table means to create the table structure (automatically saving the table in the database file). To alter a table, means to alter the table structure. It is not anybody who has the right to alter a table. You will be able to do that now because you are the database administrator, since you have the default user ID, DBA. Since you still have the password, sql, it means anybody can do what you have the right to do. To stop others from doing what you can do you should change the password; however for the sake of simplicity, do not do that for this series. A database administrator has the rights to do anything in the database.

We shall start by looking at some examples, which alter tables. After that I will give you the complete syntax and explain how to read the complete syntax.

Example We continue with the wholesale example.

- Type the following commands in the command prompt to start the database and server and connect to the database through Interactive SQL; when you type one command, wait for it to take effect before you type the next:

cd c: dbeng12 -n wholesalesrv c:\wholesale\wholesale.db dbisql -c "server=wholesalesrv;DBF=c:\sholesale\wholesale.db;UID=DBA;PWD=sql"

- We shall add the CHECK constraint, CHECK (CostPrice > 0), to the CostPrice column of the Products table. Type the following statement in the SQL Statements pane in the Interactive SQL window and then click the Play Button in the Tools bar to execute the statement.

ALTER TABLE Products ALTER CostPrice ADD CHECK (CostPrice > 0);

All SQL statements end with semicolon. If everything goes well you should see result in the Results pane, otherwise a new window will appear indicating the error.

- Let us alter the SellingPrice column in the Products table in a similar way. Erase the present statement in the SQL Statement pane and type the following; click the Play Button or SQL>>Execute from the menu, for execution:

ALTER TABLE Products ALTER SellingPrice ADD CHECK (SellingPrice > 0);

It should be executed without errors. We shall now add Total columns in the Sales and Orders table.

- Erase the present SQL statement in the SQL Statement pane. Type and execute the following command:

ALTER TABLE Sales ADD TOTAL NUMERIC(19,2);

The SQL Statement should have been executed.

- You will now do a similar thing for the Orders table. Erase what you have just typed in the SQL Statement pane. Type and execute the following:

ALTER TABLE Orders ADD TOTAL NUMERIC(19,2);

A Total column is a computed value column. Sybase SQL Anywhere 12 gives you the possibility of typing in the formula (expression) that would do the calculation and put the answer there automatically; however I will not go into that in this part of the series.

Dropping a Table In simple terms the SQL statement syntax to drop a table is:

DROP TABLE table-name;

You will now create a table in the database and then drop it. Dropping a table means erasing the table from the database file.

- Erase what is in the SQL Statement pane in the Interactive SQL window; type and execute the following:

CREATE TABLE Purchase ( purchase_num INTEGER NOT NULL PRIMARY KEY, date_purchased DATE, name CHAR(80) );

You should now have a new table called Purchase.

- Now you will delete the table you have just created and have automatically saved. Erase what you have typed in the SQL Statement pane. Type the following and execute:

DROP TABLE Purchase;

The new table purchase should have been erased.

Let us now stop the connection, stop the database and stop the server.

- Close the Interactive SQL window; if it asks you to save anything, click No.

- Type the following command in the command prompt and press the Enter key to do the three stops; if it asks you to type Y, type it and press the Enter key.

dbstop wholesalesrv

Complete Syntax to Alter a Table The complete syntax of the SQL Statement to alter a table is given below; glance through it and read the explanation below it:

ALTER TABLE [owner.]table-name { alter-clause, ... }

alter-clause : ADD create-clause | ALTER column-name column-alteration | ALTER [ CONSTRAINT constraint-name ] CHECK ( condition ) | DROP drop-object | RENAME rename-object | table-alteration

create-clause : column-name [ AS ] column-data-type [ new-column-attribute ... ] | table-constraint | PCTFREE integer

column-alteration : { column-data-type | alterable-column-attribute } [ alterable-column-attribute ... ] | SET COMPUTE ( compute-expression ) | ADD [ constraint-name ] CHECK ( condition ) | DROP { DEFAULT | COMPUTE | CHECK | CONSTRAINT constraint-name }

drop-object : column-name | CHECK | CONSTRAINT constraint-name | UNIQUE [ CLUSTERED ] ( index-columns-list ) | FOREIGN KEY fkey-name | PRIMARY KEY

rename-object : new-table-name | column-name TO new-column-name | CONSTRAINT constraint-name TO new-constraint-name

table-alteration : PCTFREE DEFAULT | [ NOT ] ENCRYPTED

new-column-attribute : NULL | DEFAULT default-value | COMPRESSED | INLINE { inline-length | USE DEFAULT } | PREFIX { prefix-length | USE DEFAULT } | [ NO ] INDEX | IDENTITY | COMPUTE ( expression ) | column-constraint

table-constraint : [ CONSTRAINT constraint-name ] { CHECK ( condition ) | UNIQUE [ CLUSTERED | NONCLUSTERED ] ( column-name [ ASC | DESC ], ... ) | PRIMARY KEY [ CLUSTERED | NONCLUSTERED ] ( column-name [ ASC | DESC ], ... ) | foreign-key }

column-constraint : [ CONSTRAINT constraint-name ] { CHECK ( condition ) | UNIQUE [ CLUSTERED | NONCLUSTERED ] [ ASC | DESC ] | PRIMARY KEY [ CLUSTERED | NONCLUSTERED ] [ ASC | DESC ] | REFERENCES table-name [ ( column-name ) ] [ MATCH [ UNIQUE ] { SIMPLE | FULL } ] [ actions ][ CLUSTERED | NONCLUSTERED ] | NOT NULL }

alterable-column-attribute : [ NOT ] NULL | DEFAULT default-value | [ CONSTRAINT constraint-name ] CHECK { NULL | ( condition ) } | [ NOT ] COMPRESSED | INLINE { inline-length | USE DEFAULT } | PREFIX { prefix-length | USE DEFAULT } | [ NO ] INDEX

default-value : special-value | string | global variable | [ - ] number | ( constant-expression ) | built-in-function ( constant-expression ) | AUTOINCREMENT | GLOBAL AUTOINCREMENT [ ( partition-size ) ] | NULL | TIMESTAMP | UTC TIMESTAMP | LAST USER | USER

special-value : CURRENT { DATABASE | DATE | REMOTE USER | TIME | TIMESTAMP | UTC TIMESTAMP | USER | PUBLISHER }

foreign-key : [ NOT NULL ] FOREIGN KEY [ role-name ] [ ( column-name [ ASC | DESC ], ... ) REFERENCES table-name [ ( pkey-column-list ) ] [ MATCH [ UNIQUE] { SIMPLE | FULL } ] [ actions ] [ CHECK ON COMMIT ] [ CLUSTERED ] [ FOR OLAP WORKLOAD ]

actions : [ ON UPDATE action ] [ ON DELETE action ]

action : CASCADE | SET NULL | SET DEFAULT | RESTRICT

[Collapse/expand section] Syntax 2 - Disabling view dependencies

Explaining the Syntax I will just explain how I came about the following statement:

ALTER TABLE Products ALTER CostPrice ADD CHECK (CostPrice > 0);

I used this statement above to add a CHECK constraint to the CostPrice column of the Products table.

The complete syntax is in sections. The lower you go down the syntax the more details you find about a word or phrase above in the syntax. In the syntax, | means and/or; anything in square brackets is optional; consider the word, expression, as a column name or value; phrases or words in lower case should be replaced by names of your choice in your SQL statement.

The first line in the syntax is:

ALTER TABLE [owner.]table-name { alter-clause, ... }

From this first line, I got

ALTER TABLE Products

for my own statement and I then proceeded to the details of, alter-clause, in the syntax. From the second line of the details of, alter clause, I got

ALTER CostPrice

for my statement. The second line of the details of, alter clause, ends with, column-alteration. I then went to the details of, column-alteration, and from the third line of the details of, column-alteration, I got,

ADD CHECK (CostPrice > 0)

for my statement.

That is the kind of procedure you should follow to determine your own Altering SQL statements. You should apply the same reasoning to understand other syntaxes in Sybase, such as the CREATE TABLE syntax we saw in one of the previous parts of the series.

Time to take a break. Let us stop here and continue in the next part.

Chrys

To arrive at any of the parts of this division, type the corresponding title below in the search box of this page and click Search (use menu if available).

Implementing Database in Sybase - Part 1 Implementing Database in Sybase - Part 2 Implementing Database in Sybase - Part 3 Implementing Database in Sybase - Part 4 Implementing Database in Sybase - Part 5 Implementing Database in Sybase - Part 6 Implementing Database in Sybase - Part 7 Implementing Database in Sybase - Part 8 Implementing Database in Sybase - Part 9 Implementing Database in Sybase - Part 10





iAutoblog the premier autoblogger software
READ MORE - Altering And Dropping Tables in Sybase