A row in table companies contains the name of a company and the name of the nationality of the company. A row in table trades contains the unique ID of the trade, the name of the selling company, the name of the buying company and the value of the traded goods.write an SQL query that returns a table consisting of the 3 columns, country, export, import, which contain the sums of the values of the exported(sold to other countries) amd imported (purchased from other countries) goods for every country. Each country should appear in this table the result table should be sorted increasingly by country. for example, for:companies: +-------------+--------------------+ | name | country | +-------------+--------------------+ | Alice s.p. | Wonderland | | Y-zap | Wonderland | | Absolute | Mathlands | | Arcus t.g. | Mathlands | | Lil Mermaid | Underwater Kingdom | | None at all | Nothingland | +-------------+--------------------+ trades : +----------+-------------+------------+-------+ | id | seller | buyer | value | +----------+-------------+------------+-------+ | 20121107 | Lil Mermaid | Alice s.p. | 10 | | 20123112 | Arcus t.g. | Y-zap | 30 | | 20120125 | Alice s.p. | Arcus t.g. | 100 | | 20120216 | Lil Mermaid | Absolute | 30 | | 20120217 | Lil Mermaid | Absolute | 50 | +----------+-------------+------------+-------+ your query should return: +--------------------+--------+--------+ | country | export | import | +--------------------+--------+--------+ | Mathlands | 30 | 180 | | Nothingland | 0 | 0 | | Underwater Kingdom | 90 | 0 | | Wonderland | 100 | 40 | +--------------------+--------+--------+ Assume that : There is no trade between companies within a single country; Every company in the table trades also appears in the table companies; Every company appears in table companies exactly once.
dayakar_dn
Posts
-
sql query using companies and traders table -
Naming Conversion Issue in Host nameHi, we have hosted 4 server setup in a domain , and all the hosted machine are having _ (Underscore) like 2k12_4Server1 . we are using Win2k12 environment, and DNS is not having _ Will it affect my Session...Some people are saying "Yes" and Some are "NO"... If Microsoft is not supporting _ it has give error, as we are getting for other special characters..... but we are not getting any issue while creating the host machine... wht will be the issue , with the application? or above one? help me as soon as possible......
-
RadWindow Problem on refreshing the page..i am having x.aspx radwindow page which contains 5 tabs, if i click the 5th tab( Delete user), radwindow pop up will be dislayed with option ok and cancel, if i click ok.. i am closing the popup and coming back to the 5th tab(Delete user), if i am using the following code, GetRadWindow().BrowserWindow.location.reload(); I get an IE7 popup dialog, saying "To display the webpage again, Internet explorer needs to resnd the Information you've previously submitted. If you were making a purchase ...blah blah with Retry + Cancel buttons if i use the below instead, top.location,href= top.location.href i am not getting an error as explained above but it is navigating into fist tab( Request user)... Tried all the option like window.location.reload()etc... can u share ur thoughts as soon as possible..... plz...
-
attr disabled property is not working for FFHi, i like to disable the buttons on check of the checkbox....using Jquery i have tried in 3 different ways... 1.attr("disabled", true)-- working in IE not in FF 2.attr("disabled", "disabled")- working in IE not in FF 3.attr("diabled") not working in both... i want to know the property which is supported by all the browsers(like safari, chrome etc..) thanks in advance
-
Making a service call for json objectHi , i am using page life cycle for AJAX webservice call.. OnPreRenderComplete , i am having result of the first service call in the form of JSON.. before rendering this data to js page.. i want to make a another service call for the one of the json data...and i want to render these information to js finally... 2 service call... with the first service call result i want to make a another call...the full data i want to render back... kindly suggest best way to do so.. thanks in advance..
-
Problem with args.isValid in JSSorry function name should be applyclick
-
Problem with args.isValid in JSHi, i am not able set the args.isValid as false for JS function...which is not having custom validator.. find the code below:
<asp:LinkButton runat="server" ID="btnApply" TabIndex="1" CssClass=" primary" OnClientClick = "return ApplyClick(this);" >
JS Code:
function Applyclick(args) {
if (errMsg != null) {
args.IsValid = false;}
return false;
}thanks in advance
-
Problem with custom validator in asp.netHi, I am having one text box and two button named APPLY and START, and two custom validator, both i am validating in jquery. in one custom control i have given controlTovalidate to Textbox... for another custom control i haven't given any controltoValidate...mainly for validation on click of "Start" button... As per my knowledge both should be get tiggered.. but in one secnario like when the first custom validator args.isValid is true.. that time.. second Custom validator is not getting triggered... code of the first custom control
if (!promoCd.match(regEx))
// if promocode is not an integer of length 9 or 10 then return invalid
{$("#" + ClientId + "\_" + "spnPromoNotEnt").hide(); $("#" + ClientId + "\_" + "spnPromoNotReg").show(); args.IsValid = false; validateResult = false; } else { { args.IsValid = true; validateResult = true; $("#" + ClientId + "\_" + "spnPromoNotEnt").hide(); $("#" + ClientId + "\_" + "spnPromoNotReg").hide(); $("#TopMessagePanel").hide(); } }
when else part of the first custom code execute.. then second custom control not getting triggered
second custom validator code
function ValidatePromoCode(source, args) {
if (Response == null && validateResult == true) { if ($("#" + clientId + "\_txtPromo").val().length > 0) { args.IsValid = false; } } else if (validateResult != true) { $("#TopMessagePanel").hide(); }
}
thanks in advance
-
Is it possible to get the AJAX service response in user control?Hi friends, i am having AJAX call in common.js , like data type: Json and URl : sample.aspx, i have registered the user control in the aspx page(sample.ascx)... where i am registering the webservice call in Onprerender.. and binding the result into user control in onpreRenderComplete... and getting back the result in the form of JSON in javascipt... As i want to assign this result in to Enum... is it possible to get the response result in user control?.. or any other way to assign the result into enum in js ? thanks and regards, Dayakar.dn
-
how to populate content of aspx page(having Div and span tag) in to overlatHi friends, i am having aspx page with
information
... andone js file contains code for overlay... i want to populate the span information as overlay content.. thanks in advance
-
how to open the minimized window after refreshing the page?Hi, i am having one window and overlay.. when i am clicking the link, first overlay will be displayed and iam clicking the accept button in the overlay..then new window will be opened.. now i am minimizing the window after refreshing the page when i am clicking the link...minimized windonw should be opened..instead of overlay...
xxx = window.open(URL, "tool", "width=800, height=700, left=0, top=0, scrollbars=Yes,resizable=yes, menubar=no,directories=no,location=no");
tool.focus();xxx variable is showing null once i refreshing the page...then how can i get to know the existing and minimized window? i have used the below code...but didn't work for my requirement..
if (!xxx.document.URL || xxx.document.URL.valueOf("tool") == 0) {
alert("hi");
}thanks in advance
-
Problem when loading solution in the VS2010Hi, As pete said i tried to find out the error through event viewer and i have seen so many error and warning as follows
source : TFSShellExt
TFS Shell Extention event:\n Failed to create COM provider for notification event
TFS Shell Extension event:\n Failed to start COMProvider while updating workspaces.
TFS Shell Extension event:\n More than 5 failed calls to com provider.
kindly share your inputs on this error.. thanks in advance..
-
Problem when loading solution in the VS2010Hi, When i am tring to open solution in VS IDE.. i am getting message like "Microsoft VS 2010 has encountered a problem and need to close.We sorry for the inconvenience.".. i have reinstalled the Service Pack...then i got the same message and also i have reinstalled the VS2010 premium...still i am facing problem... can any one tell what might be the exact problem?... Note :i am not using Laptop, i am using remote desktop...i haven't installed softwares...sevice is used to do so..
-
Jquery with Update PanelHi, I am implementing JQUERY Datepicker with JQuery Mask in one user control also i have custom js page,in that page only i am calling .mask function. It is working fine but when i put this user control inside update panel, when page loads fist time i am able to see my mask but when i am trying to delete the date by that time mask also deleting. After that i put my code inside function pageLoad(sender, args) but still i am facing same problem. If you any one is having solution for this please let me know.
-
Regarding JQueryCurrencyHi, By using JqueryCurrency i am reading the currency symbold based on locale, but when i am trying to read the UK currency symbol, instead of pound symbol it is reading some junk data. Any one faced the same problem please let me know the solution to read the pound symbol. Thanks in Advance.
-
SharepointPortal ContentsHi, I am planning to learn SharePoint Portal 2010(Developer), can any one guide me what are the concepts i need to learn as a Developer. Thanks in advance.
-
Regarding Textbox Control.hi, This is regarding textbox control, while seeing the page it is showing one value eg: 12/31/1969 but in the view source code of that page shows 12/58/2010. How can it possible.
-
Regarding AjaxToolkit.hi, In my project i am using "ajaxToolkit:CalendarExtender" with Textbox. If i am entering invalid date like 12/56/2010(mm/dd/yyyy), that time i am getting proper validation message but after getting the msg the textbox.text is getting changed into 12/31/1969 default. In the code no where i wrriten the code like this. But when see the view source code of the page, textbox value contains invalid date. This is strange thing that i am facing. Anybody knows the root cause of this please tell me. The code is Thanks in Advance for your solution.
-
Developing Remainder Applicationhi, I want to develop an application to remaind me to fill timesheet everyday. Please can guide me how to develop this application. But i am planning to develope this application using Dotnet technology.
-
Refering Shared assemblieshi, I created shared assmebly and i installed in gacutil, now i want to use this in another application. my question how to get the dll in any new application.